From dbb89ce9c5ba41259f2aa4917b25721b6fc9691f Mon Sep 17 00:00:00 2001 From: Claude Date: Wed, 18 Nov 2026 18:12:24 +0000 Subject: [PATCH] Night 2: 40-card Magic-style duel, PvP with owned decks, polite Wikimedia client, Android mining (#23) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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: https://gitea.eom.dev/WikiDeck/wikideck/pulls/23 Co-authored-by: Claude --- .gitignore | 4 + android/app/build.gradle | 7 + .../java/dev/eom/wikideck/MainActivity.java | 11 +- .../java/dev/eom/wikideck/MinerPlugin.java | 264 + android/build-debug.sh | 6 +- deploy/night/README.md | 2 +- deploy/night/autodeploy.sh | 2 +- deploy/night/compose.lan.yaml | 8 + docs/game/DUEL_API.md | 89 + docs/game/DUEL_BALANCE.md | 124 + docs/game/DUEL_DESIGN.md | 279 + docs/game/HOSTING.md | 27 +- docs/game/OWNERSHIP_API.md | 73 + docs/game/duel-card-sample.json | 10821 ++++++++++++++++ docs/night2/BRIEF.md | 144 + docs/night2/HANDBOOK.md | 88 + docs/night2/MOBILE_MINING.md | 78 + docs/night2/PLAN.md | 120 + docs/night2/TESTNET.md | 67 + docs/night2/WIKIMEDIA.md | 72 + docs/night2/analysis/connected.py | 44 + docs/night2/analysis/fields.py | 23 + docs/night2/analysis/stats.py | 59 + docs/night2/analysis/types.py | 79 + docs/night2/mobile-mining-accepted.jpg | Bin 0 -> 17643 bytes docs/night2/reviews/critic.md | 171 + docs/night2/reviews/data.md | 272 + docs/night2/reviews/designer.md | 278 + docs/night2/reviews/engineer.md | 246 + scripts/build-randomx-android.sh | 35 + scripts/duel-card-sample.ts | 32 + scripts/night2/prebake-identity.ts | 56 + scripts/sim/duel-core-sim.ts | 68 + scripts/sim/duel-decks.ts | 49 + scripts/sim/duel-run.ts | 138 + scripts/sim/duel-sim-types.ts | 18 + scripts/sim/duel-standin-adapter.ts | 76 + scripts/sim/duel-standin.ts | 229 + scripts/sim/duel-stats.ts | 156 + server/account/router.ts | 19 +- server/enrichment.ts | 99 +- server/game/collection.ts | 76 + server/game/config.ts | 8 +- server/game/duel-binding.ts | 86 + server/game/engine-port.ts | 30 + server/game/host.ts | 364 +- server/game/identity-source.ts | 113 + server/game/identity.ts | 204 + server/game/index.ts | 53 +- server/game/modes/classic.json | 31 +- server/game/modes/draft.json | 25 +- server/game/modes/edit-war-draft.json | 30 + server/game/modes/edit-war-trending.json | 30 + server/game/modes/edit-war.json | 24 + server/game/modes/trending.json | 26 +- server/game/ownership.ts | 211 + server/game/router.ts | 33 +- server/game/store.ts | 42 +- server/testnet/http.ts | 24 +- server/wiki.ts | 32 +- server/wikimedia-user-agent.ts | 47 +- server/wikimedia/cache.ts | 74 + server/wikimedia/client.ts | 441 + server/wikimedia/index.ts | 36 + server/wikimedia/pool.ts | 88 + shared/bots/duel-adapter.ts | 176 + shared/bots/duel-bots.ts | 233 + shared/duel/classify.ts | 184 + shared/duel/derive.ts | 325 + shared/duel/effects.ts | 116 + shared/duel/engine.ts | 908 ++ shared/duel/index.ts | 40 + shared/duel/profile.ts | 114 + shared/duel/ruleset.ts | 78 + shared/duel/sample.ts | 41 + shared/duel/story/fromDuel.ts | 117 + shared/duel/story/index.ts | 6 + shared/duel/story/log.ts | 196 + shared/duel/story/recap.ts | 290 + shared/duel/story/templates.ts | 156 + shared/duel/story/types.ts | 98 + shared/duel/text.ts | 149 + shared/duel/types.ts | 398 + shared/game/modes.ts | 53 +- src/App.tsx | 31 +- src/MobileMiningPanel.tsx | 144 + src/auth/session.ts | 3 + src/game/Leaderboards.tsx | 20 + src/game/OnlinePlay.tsx | 121 +- src/game/PlaySection.tsx | 190 +- src/game/collection/CollectionScreen.tsx | 69 + src/game/collection/collection.ts | 108 + src/game/collection/duelModes.ts | 21 + src/game/collection/pvp.css | 37 + src/game/collection/useCollection.ts | 33 + src/game/duel/DuelBoard.tsx | 39 + src/game/duel/DuelBotMatch.tsx | 80 + src/game/duel/DuelCardFace.tsx | 90 + src/game/duel/DuelGate.tsx | 24 + src/game/duel/DuelPreview.tsx | 27 + src/game/duel/DuelTable.tsx | 251 + src/game/duel/adapter.ts | 109 + src/game/duel/bots.ts | 83 + src/game/duel/cards.ts | 50 + src/game/duel/contract.ts | 146 + src/game/duel/controller.ts | 44 + src/game/duel/decks.ts | 40 + src/game/duel/duel.css | 167 + src/game/duel/mock.ts | 105 + src/game/duel/model.ts | 235 + src/game/online.ts | 106 + src/game/recap/BattleRecap.tsx | 92 + src/game/recap/model.ts | 170 + src/game/recap/recap.css | 29 + src/main.tsx | 19 +- src/mobile-miner.ts | 173 + src/mobile-mining.css | 10 + tests/duel-cards-derive.test.ts | 255 + tests/duel-cards-engine.test.ts | 48 + tests/duel-cards-profile.test.ts | 71 + tests/duel-core-effects.test.ts | 161 + tests/duel-core-engine.test.ts | 209 + tests/duel-core-fixtures.ts | 110 + tests/duel-core-ruleset.test.ts | 41 + tests/duel-design-fromduel.test.ts | 72 + tests/duel-design-story.golden.json | 50 + tests/duel-design-story.test.ts | 256 + tests/e2e/ui-pvp-smoke.mjs | 88 + tests/enrichment.test.ts | 2 +- tests/host-pvp-binding.test.ts | 185 + tests/host-pvp-host.test.ts | 369 + tests/mobile-mining-miner.test.ts | 121 + tests/modes-api.test.ts | 40 +- tests/modes-host.test.ts | 28 +- tests/modes-schema.test.ts | 2 +- tests/ownership-deck.test.ts | 291 + tests/sim-balance-duel-adapter.test.ts | 51 + tests/sim-balance-duel.test.ts | 70 + tests/testnet-ops-identity-source.test.ts | 82 + tests/testnet-ops-identity.test.ts | 90 + tests/testnet-user-agent.test.ts | 26 +- tests/ui-duel-adapter.test.ts | 124 + tests/ui-duel-bots.test.ts | 53 + tests/ui-duel-model.test.ts | 120 + tests/ui-pvp-collection.test.ts | 99 + tests/ui-pvp-recap.test.ts | 105 + tests/wiki.test.ts | 5 +- tests/wikimedia-client.test.ts | 236 + tests/wikimedia-helpers.ts | 52 + tests/wikimedia-mint.test.ts | 104 + tests/wikimedia-pool.test.ts | 74 + 151 files changed, 26435 insertions(+), 360 deletions(-) create mode 100644 android/app/src/main/java/dev/eom/wikideck/MinerPlugin.java create mode 100644 docs/game/DUEL_API.md create mode 100644 docs/game/DUEL_BALANCE.md create mode 100644 docs/game/DUEL_DESIGN.md create mode 100644 docs/game/OWNERSHIP_API.md create mode 100644 docs/game/duel-card-sample.json create mode 100644 docs/night2/BRIEF.md create mode 100644 docs/night2/HANDBOOK.md create mode 100644 docs/night2/MOBILE_MINING.md create mode 100644 docs/night2/PLAN.md create mode 100644 docs/night2/TESTNET.md create mode 100644 docs/night2/WIKIMEDIA.md create mode 100644 docs/night2/analysis/connected.py create mode 100644 docs/night2/analysis/fields.py create mode 100644 docs/night2/analysis/stats.py create mode 100644 docs/night2/analysis/types.py create mode 100644 docs/night2/mobile-mining-accepted.jpg create mode 100644 docs/night2/reviews/critic.md create mode 100644 docs/night2/reviews/data.md create mode 100644 docs/night2/reviews/designer.md create mode 100644 docs/night2/reviews/engineer.md create mode 100755 scripts/build-randomx-android.sh create mode 100644 scripts/duel-card-sample.ts create mode 100644 scripts/night2/prebake-identity.ts create mode 100644 scripts/sim/duel-core-sim.ts create mode 100644 scripts/sim/duel-decks.ts create mode 100644 scripts/sim/duel-run.ts create mode 100644 scripts/sim/duel-sim-types.ts create mode 100644 scripts/sim/duel-standin-adapter.ts create mode 100644 scripts/sim/duel-standin.ts create mode 100644 scripts/sim/duel-stats.ts create mode 100644 server/game/collection.ts create mode 100644 server/game/duel-binding.ts create mode 100644 server/game/identity-source.ts create mode 100644 server/game/identity.ts create mode 100644 server/game/modes/edit-war-draft.json create mode 100644 server/game/modes/edit-war-trending.json create mode 100644 server/game/modes/edit-war.json create mode 100644 server/game/ownership.ts create mode 100644 server/wikimedia/cache.ts create mode 100644 server/wikimedia/client.ts create mode 100644 server/wikimedia/index.ts create mode 100644 server/wikimedia/pool.ts create mode 100644 shared/bots/duel-adapter.ts create mode 100644 shared/bots/duel-bots.ts create mode 100644 shared/duel/classify.ts create mode 100644 shared/duel/derive.ts create mode 100644 shared/duel/effects.ts create mode 100644 shared/duel/engine.ts create mode 100644 shared/duel/index.ts create mode 100644 shared/duel/profile.ts create mode 100644 shared/duel/ruleset.ts create mode 100644 shared/duel/sample.ts create mode 100644 shared/duel/story/fromDuel.ts create mode 100644 shared/duel/story/index.ts create mode 100644 shared/duel/story/log.ts create mode 100644 shared/duel/story/recap.ts create mode 100644 shared/duel/story/templates.ts create mode 100644 shared/duel/story/types.ts create mode 100644 shared/duel/text.ts create mode 100644 shared/duel/types.ts create mode 100644 src/MobileMiningPanel.tsx create mode 100644 src/game/collection/CollectionScreen.tsx create mode 100644 src/game/collection/collection.ts create mode 100644 src/game/collection/duelModes.ts create mode 100644 src/game/collection/pvp.css create mode 100644 src/game/collection/useCollection.ts create mode 100644 src/game/duel/DuelBoard.tsx create mode 100644 src/game/duel/DuelBotMatch.tsx create mode 100644 src/game/duel/DuelCardFace.tsx create mode 100644 src/game/duel/DuelGate.tsx create mode 100644 src/game/duel/DuelPreview.tsx create mode 100644 src/game/duel/DuelTable.tsx create mode 100644 src/game/duel/adapter.ts create mode 100644 src/game/duel/bots.ts create mode 100644 src/game/duel/cards.ts create mode 100644 src/game/duel/contract.ts create mode 100644 src/game/duel/controller.ts create mode 100644 src/game/duel/decks.ts create mode 100644 src/game/duel/duel.css create mode 100644 src/game/duel/mock.ts create mode 100644 src/game/duel/model.ts create mode 100644 src/game/recap/BattleRecap.tsx create mode 100644 src/game/recap/model.ts create mode 100644 src/game/recap/recap.css create mode 100644 src/mobile-miner.ts create mode 100644 src/mobile-mining.css create mode 100644 tests/duel-cards-derive.test.ts create mode 100644 tests/duel-cards-engine.test.ts create mode 100644 tests/duel-cards-profile.test.ts create mode 100644 tests/duel-core-effects.test.ts create mode 100644 tests/duel-core-engine.test.ts create mode 100644 tests/duel-core-fixtures.ts create mode 100644 tests/duel-core-ruleset.test.ts create mode 100644 tests/duel-design-fromduel.test.ts create mode 100644 tests/duel-design-story.golden.json create mode 100644 tests/duel-design-story.test.ts create mode 100644 tests/e2e/ui-pvp-smoke.mjs create mode 100644 tests/host-pvp-binding.test.ts create mode 100644 tests/host-pvp-host.test.ts create mode 100644 tests/mobile-mining-miner.test.ts create mode 100644 tests/ownership-deck.test.ts create mode 100644 tests/sim-balance-duel-adapter.test.ts create mode 100644 tests/sim-balance-duel.test.ts create mode 100644 tests/testnet-ops-identity-source.test.ts create mode 100644 tests/testnet-ops-identity.test.ts create mode 100644 tests/ui-duel-adapter.test.ts create mode 100644 tests/ui-duel-bots.test.ts create mode 100644 tests/ui-duel-model.test.ts create mode 100644 tests/ui-pvp-collection.test.ts create mode 100644 tests/ui-pvp-recap.test.ts create mode 100644 tests/wikimedia-client.test.ts create mode 100644 tests/wikimedia-helpers.ts create mode 100644 tests/wikimedia-mint.test.ts create mode 100644 tests/wikimedia-pool.test.ts diff --git a/.gitignore b/.gitignore index a34d4d9..d6d4a52 100644 --- a/.gitignore +++ b/.gitignore @@ -28,3 +28,7 @@ dist-ssr *.njsproj *.sln *.sw? + +# Native RandomX engine for the app (scripts/build-randomx-android.sh) +native/build-android-*/ +android/app/src/main/jniLibs/ diff --git a/android/app/build.gradle b/android/app/build.gradle index 58a9e88..093389e 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -16,6 +16,13 @@ android { ignoreAssetsPattern '!.svn:!.git:!.ds_store:!*.scc:.*:!CVS:!thumbs.db:!picasa.ini:!*~' } } + packagingOptions { + jniLibs { + // The RandomX engine (jniLibs//libwikideck_randomx.so) is an executable, not a JNI library. + // Android may exec it only from the extracted nativeLibraryDir, so keep legacy extraction. + useLegacyPackaging true + } + } buildTypes { release { minifyEnabled false diff --git a/android/app/src/main/java/dev/eom/wikideck/MainActivity.java b/android/app/src/main/java/dev/eom/wikideck/MainActivity.java index 94c31d3..f6d5dbd 100644 --- a/android/app/src/main/java/dev/eom/wikideck/MainActivity.java +++ b/android/app/src/main/java/dev/eom/wikideck/MainActivity.java @@ -1,5 +1,14 @@ package dev.eom.wikideck; +import android.os.Bundle; + import com.getcapacitor.BridgeActivity; -public class MainActivity extends BridgeActivity {} +public class MainActivity extends BridgeActivity { + @Override + public void onCreate(Bundle savedInstanceState) { + // Local plugins must be registered before the bridge starts. + registerPlugin(MinerPlugin.class); + super.onCreate(savedInstanceState); + } +} diff --git a/android/app/src/main/java/dev/eom/wikideck/MinerPlugin.java b/android/app/src/main/java/dev/eom/wikideck/MinerPlugin.java new file mode 100644 index 0000000..07732dc --- /dev/null +++ b/android/app/src/main/java/dev/eom/wikideck/MinerPlugin.java @@ -0,0 +1,264 @@ +package dev.eom.wikideck; + +import android.content.BroadcastReceiver; +import android.content.Context; +import android.content.Intent; +import android.content.IntentFilter; +import android.os.BatteryManager; +import android.os.Build; +import android.os.PowerManager; + +import com.getcapacitor.JSObject; +import com.getcapacitor.Plugin; +import com.getcapacitor.PluginCall; +import com.getcapacitor.PluginMethod; +import com.getcapacitor.annotation.CapacitorPlugin; + +import java.io.BufferedReader; +import java.io.File; +import java.io.InputStreamReader; +import java.io.OutputStream; +import java.nio.charset.StandardCharsets; +import java.util.ArrayList; +import java.util.List; +import java.util.concurrent.ExecutorService; +import java.util.concurrent.Executors; +import java.util.concurrent.TimeUnit; +import java.util.regex.Pattern; + +/** + * Native RandomX engine for the WikiDeck app (sideload build only, see docs/night2/MOBILE_MINING.md). + * + * The plugin only runs the pinned `wikideck-randomx` executable (shipped as jniLibs//libwikideck_randomx.so) + * in LIGHT mode and speaks its line protocol (docs/randomx-native.md). It never sees wallet keys: the WebView builds + * the work blob, signs the block claim with the web wallet, and submits it to the node. This class also enforces the + * device safeguards: engines are killed when the app goes to the background, on battery saver, when the device is + * hot, or when the battery is low and not charging. Each stop is reported to the WebView as a `halted` event. + */ +@CapacitorPlugin(name = "WikiDeckMiner") +public class MinerPlugin extends Plugin { + private static final String BINARY = "libwikideck_randomx.so"; + private static final int MAX_THREADS = 4; + /** At or above Android's THERMAL_STATUS_MODERATE we stop. */ + private static final int THERMAL_LIMIT = 2; + /** Battery temperature limit in tenths of a degree Celsius. */ + private static final int BATTERY_TEMP_LIMIT = 400; + private static final int LOW_BATTERY_PERCENT = 20; + private static final Pattern HEX = Pattern.compile("^[0-9a-f]+$"); + + private final List engines = new ArrayList<>(); + private BroadcastReceiver receiver; + private Object thermalListener; + + /** One long-lived engine process with exactly one outstanding command (it is strictly request/response). */ + private static final class Engine { + final Process process; + final OutputStream in; + final BufferedReader out; + final ExecutorService worker = Executors.newSingleThreadExecutor(); + Engine(Process process) { + this.process = process; + this.in = process.getOutputStream(); + this.out = new BufferedReader(new InputStreamReader(process.getInputStream(), StandardCharsets.US_ASCII)); + } + String command(String line) throws Exception { + in.write((line + "\n").getBytes(StandardCharsets.US_ASCII)); + in.flush(); + String reply = out.readLine(); + if (reply == null) throw new Exception("RandomX engine exited"); + return reply; + } + void kill() { + worker.shutdownNow(); + try { in.close(); } catch (Exception ignored) { } + process.destroy(); + try { if (!process.waitFor(1, TimeUnit.SECONDS)) process.destroyForcibly(); } catch (InterruptedException ignored) { } + } + } + + private File binary() { + return new File(getContext().getApplicationInfo().nativeLibraryDir, BINARY); + } + + @Override + public void load() { + receiver = new BroadcastReceiver() { + @Override public void onReceive(Context context, Intent intent) { checkAndHalt(); } + }; + IntentFilter filter = new IntentFilter(); + filter.addAction(PowerManager.ACTION_POWER_SAVE_MODE_CHANGED); + filter.addAction(Intent.ACTION_BATTERY_CHANGED); + getContext().registerReceiver(receiver, filter); + if (Build.VERSION.SDK_INT >= 29) { + PowerManager pm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); + PowerManager.OnThermalStatusChangedListener l = status -> checkAndHalt(); + pm.addThermalStatusListener(l); + thermalListener = l; + } + } + + @Override + protected void handleOnPause() { + halt("background"); + super.handleOnPause(); + } + + @Override + protected void handleOnDestroy() { + halt("closed"); + try { getContext().unregisterReceiver(receiver); } catch (Exception ignored) { } + if (Build.VERSION.SDK_INT >= 29 && thermalListener != null) { + PowerManager pm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); + pm.removeThermalStatusListener((PowerManager.OnThermalStatusChangedListener) thermalListener); + } + super.handleOnDestroy(); + } + + /** Current device state and, if mining must not run, the reason. */ + private JSObject conditionsObject() { + PowerManager pm = (PowerManager) getContext().getSystemService(Context.POWER_SERVICE); + Intent battery = getContext().registerReceiver(null, new IntentFilter(Intent.ACTION_BATTERY_CHANGED)); + int temp = battery == null ? -1 : battery.getIntExtra(BatteryManager.EXTRA_TEMPERATURE, -1); + int level = battery == null ? -1 : battery.getIntExtra(BatteryManager.EXTRA_LEVEL, -1); + int scale = battery == null ? -1 : battery.getIntExtra(BatteryManager.EXTRA_SCALE, -1); + int plugged = battery == null ? 0 : battery.getIntExtra(BatteryManager.EXTRA_PLUGGED, 0); + int percent = level >= 0 && scale > 0 ? Math.round(100f * level / scale) : -1; + int thermal = Build.VERSION.SDK_INT >= 29 ? pm.getCurrentThermalStatus() : 0; + boolean powerSave = pm.isPowerSaveMode(); + String block = null; + if (powerSave) block = "battery-saver"; + else if (thermal >= THERMAL_LIMIT) block = "thermal"; + else if (temp >= BATTERY_TEMP_LIMIT) block = "battery-hot"; + else if (plugged == 0 && percent >= 0 && percent < LOW_BATTERY_PERCENT) block = "battery-low"; + JSObject o = new JSObject(); + o.put("powerSave", powerSave); + o.put("thermalStatus", thermal); + o.put("batteryTempC", temp < 0 ? null : temp / 10.0); + o.put("batteryPercent", percent); + o.put("charging", plugged != 0); + o.put("cores", Runtime.getRuntime().availableProcessors()); + o.put("abi", Build.SUPPORTED_ABIS.length > 0 ? Build.SUPPORTED_ABIS[0] : "unknown"); + o.put("engineInstalled", binary().canExecute()); + o.put("blocked", block); + return o; + } + + private void checkAndHalt() { + String block = conditionsObject().getString("blocked"); + if (block != null) halt(block); + } + + private synchronized void halt(String reason) { + if (engines.isEmpty()) return; + for (Engine e : engines) e.kill(); + engines.clear(); + JSObject event = new JSObject(); + event.put("reason", reason); + notifyListeners("halted", event); + } + + @PluginMethod + public void conditions(PluginCall call) { + call.resolve(conditionsObject()); + } + + /** Runs upstream's known-vector test (Hash test 1a/2a) on this device. */ + @PluginMethod + public void selfTest(PluginCall call) { + new Thread(() -> { + try { + Process p = new ProcessBuilder(binary().getAbsolutePath(), "--self-test").redirectErrorStream(true).start(); + p.getOutputStream().close(); + StringBuilder text = new StringBuilder(); + BufferedReader r = new BufferedReader(new InputStreamReader(p.getInputStream(), StandardCharsets.UTF_8)); + for (String line; (line = r.readLine()) != null && text.length() < 2000; ) text.append(line).append('\n'); + boolean done = p.waitFor(120, TimeUnit.SECONDS); + if (!done) p.destroyForcibly(); + JSObject o = new JSObject(); + o.put("ok", done && p.exitValue() == 0); + o.put("output", text.toString().trim()); + call.resolve(o); + } catch (Exception e) { + call.reject("Self-test failed to run: " + e.getMessage()); + } + }).start(); + } + + /** Starts 1..4 light-mode engines (more than 2 only while charging) (each needs about 256 MiB). Refuses if a safeguard is active. */ + @PluginMethod + public synchronized void start(PluginCall call) { + int threads = call.getInt("threads", 1); + if (threads < 1 || threads > MAX_THREADS || threads > Runtime.getRuntime().availableProcessors()) { call.reject("threads must be 1 to " + MAX_THREADS + " and at most the core count"); return; } + String block = conditionsObject().getString("blocked"); + if (block == null && threads > 2 && !conditionsObject().getBool("charging")) block = "max-needs-charging"; + if (block != null) { call.reject("Mining is paused: " + block, block); return; } + if (!engines.isEmpty()) { for (Engine e : engines) e.kill(); engines.clear(); } + try { + for (int i = 0; i < threads; i++) { + // No arguments = LIGHT mode. `--fast` (about 2 GiB) is never used on phones. + Process p = new ProcessBuilder(binary().getAbsolutePath()).redirectError(ProcessBuilder.Redirect.to(new File("/dev/null"))).start(); + engines.add(new Engine(p)); + } + } catch (Exception e) { + for (Engine en : engines) en.kill(); + engines.clear(); + call.reject("Could not start the RandomX engine: " + e.getMessage()); + return; + } + JSObject o = new JSObject(); + o.put("threads", threads); + call.resolve(o); + } + + @PluginMethod + public synchronized void stop(PluginCall call) { + for (Engine e : engines) e.kill(); + engines.clear(); + call.resolve(); + } + + /** + * One bounded batch on engine `lane`: `mine `. + * Resolves {found:false} on exhaustion or {found:true, hash, nonce} (nonce as a decimal string). + */ + @PluginMethod + public void mine(PluginCall call) { + String key = call.getString("key", ""), blob = call.getString("blob", ""), target = call.getString("target", ""); + int lane = call.getInt("lane", 0), offset = call.getInt("nonceOffset", -1), attempts = call.getInt("maxAttempts", 0); + if (key.length() != 64 || target.length() != 64 || blob.length() < 2 || blob.length() > 16384 || blob.length() % 2 != 0 + || !HEX.matcher(key).matches() || !HEX.matcher(target).matches() || !HEX.matcher(blob).matches() + || offset < 0 || offset + 8 > blob.length() / 2 || attempts < 1 || attempts > 10000) { + call.reject("Invalid mining request"); + return; + } + final Engine engine; + synchronized (this) { + if (lane < 0 || lane >= engines.size()) { call.reject("Miner is not running", "stopped"); return; } + engine = engines.get(lane); + } + String line = "mine " + key + " " + blob + " " + target + " " + offset + " " + attempts; + try { + engine.worker.execute(() -> { + try { + String reply = engine.command(line); + JSObject o = new JSObject(); + if (reply.equals("exhausted")) { + o.put("found", false); + } else { + String[] parts = reply.split(" "); + if (parts.length != 3 || !parts[0].equals("found") || parts[1].length() != 64 || !HEX.matcher(parts[1]).matches() + || !parts[2].matches("^[0-9]{1,20}$")) throw new Exception("Malformed engine reply"); + o.put("found", true); + o.put("hash", parts[1]); + o.put("nonce", parts[2]); + } + call.resolve(o); + } catch (Exception e) { + call.reject("Miner stopped: " + e.getMessage(), "stopped"); + } + }); + } catch (Exception e) { + call.reject("Miner is not running", "stopped"); + } + } +} diff --git a/android/build-debug.sh b/android/build-debug.sh index a114749..e3a5cfb 100755 --- a/android/build-debug.sh +++ b/android/build-debug.sh @@ -1,11 +1,15 @@ #!/bin/sh # Build the WikiDeck debug APK against the private Night-1 testnet. -# Needs ANDROID_HOME and a JDK 21 (JAVA_HOME). Output: android/app/build/outputs/apk/debug/app-debug.apk +# Needs ANDROID_HOME (with an NDK and CMake for the RandomX engine) and a JDK 21 (JAVA_HOME). Output: android/app/build/outputs/apk/debug/app-debug.apk set -eu cd "$(dirname "$0")/.." export VITE_WIKIDECK_NETWORK="${VITE_WIKIDECK_NETWORK:-testnet}" export VITE_WIKIDECK_GENESIS_TIME="${VITE_WIKIDECK_GENESIS_TIME:-1792411200}" export VITE_NODE_URL="${VITE_NODE_URL:-http://192.168.1.32:3101}" +# Native RandomX engine (jniLibs//libwikideck_randomx.so); built once, reused after (scripts/build-randomx-android.sh). +for abi in ${ABIS:-arm64-v8a x86_64}; do + [ -x "android/app/src/main/jniLibs/$abi/libwikideck_randomx.so" ] || ABIS="$abi" sh scripts/build-randomx-android.sh +done npm run build npx cap sync android cd android && ./gradlew --no-daemon -q assembleDebug diff --git a/deploy/night/README.md b/deploy/night/README.md index fa737ca..c9e2565 100644 --- a/deploy/night/README.md +++ b/deploy/night/README.md @@ -16,7 +16,7 @@ A 3-node **testnet-only** fixture on poweredge-r350. It is reachable on the LAN - `compose.lan.yaml` also sets, per node: - `WIKIDECK_USER_AGENT`, a Wikimedia-policy UA with a project URL (#19). Without it, Wikipedia returned 429 to our egress and templates failed. - the game-mode env from #22: A = classic and trending, B = draft, C = all three. -- `autodeploy.sh` follows the integration branch. Run it from a dedicated detached worktree: `git worktree add --detach ../deploy-src origin/night/2026-11-16 && cd ../deploy-src && deploy/night/autodeploy.sh`. It polls the Gitea API every 3 min and redeploys whenever the head moves. +- `autodeploy.sh` follows the integration branch. Run it from a dedicated detached worktree: `git worktree add --detach ../deploy-src origin/night/2026-11-17 && cd ../deploy-src && deploy/night/autodeploy.sh`. It polls the Gitea API every 3 min and redeploys whenever the head moves. - `testnet.sh` has `up`, `mine N [workers]`, `status` and `down`. Run it from the repo root on a checkout of the integration branch. `up` rebuilds the image from that checkout; the ledgers persist in the named volumes. Never point this at mainnet or the live `wikideck` namespace. diff --git a/deploy/night/autodeploy.sh b/deploy/night/autodeploy.sh index 3d994ea..fc1e6e8 100755 --- a/deploy/night/autodeploy.sh +++ b/deploy/night/autodeploy.sh @@ -6,7 +6,7 @@ # because lobbies are in memory and a restart ends games in progress. # Head detection uses the public Gitea API, which also works where SSH auth isn't available. set -u -BRANCH=${BRANCH:-night/2026-11-16} +BRANCH=${BRANCH:-night/2026-11-17} API=${API:-https://gitea.eom.dev/api/v1/repos/claude/wikideck} INTERVAL=${INTERVAL:-180} LOG=${LOG:-/tmp/wikideck-night-autodeploy.log} diff --git a/deploy/night/compose.lan.yaml b/deploy/night/compose.lan.yaml index a4e3a8d..c0f3790 100644 --- a/deploy/night/compose.lan.yaml +++ b/deploy/night/compose.lan.yaml @@ -1,12 +1,16 @@ # sim-testnet override: publish the fixture on r350's LAN address only (not 0.0.0.0). # WIKIDECK_USER_AGENT identifies the testnet to Wikimedia (UA policy; no personal contact info). # Game-mode env (modes team, #6) is inert until night/modes/hosting merges. +# WIKIDECK_WIKIMEDIA_NODES_PER_IP / WIKIDECK_OPERATOR_CONTACT (#62): the 3 nodes share one egress IP, so the +# polite client splits its rate and daily cap 3 ways. Inert until the wikimedia client merges. services: node-a: ports: !override ["192.168.1.32:3101:3001"] environment: PUBLIC_ORIGIN: http://192.168.1.32:3101 WIKIDECK_USER_AGENT: &ua WikiDeck-testnet/0.1 (https://gitea.eom.dev/claude/wikideck; private testnet) + WIKIDECK_WIKIMEDIA_NODES_PER_IP: &perip "3" + WIKIDECK_OPERATOR_CONTACT: &contact https://gitea.eom.dev/claude/wikideck WIKIDECK_MODES: classic,trending WIKIDECK_GAME_OPERATOR: Testnet A WIKIDECK_GAME_PEERS: http://192.168.1.32:3102,http://192.168.1.32:3103 @@ -15,6 +19,8 @@ services: environment: PUBLIC_ORIGIN: http://192.168.1.32:3102 WIKIDECK_USER_AGENT: *ua + WIKIDECK_WIKIMEDIA_NODES_PER_IP: *perip + WIKIDECK_OPERATOR_CONTACT: *contact WIKIDECK_MODES: draft WIKIDECK_GAME_OPERATOR: Testnet B WIKIDECK_GAME_PEERS: http://192.168.1.32:3101,http://192.168.1.32:3103 @@ -23,6 +29,8 @@ services: environment: PUBLIC_ORIGIN: http://192.168.1.32:3103 WIKIDECK_USER_AGENT: *ua + WIKIDECK_WIKIMEDIA_NODES_PER_IP: *perip + WIKIDECK_OPERATOR_CONTACT: *contact WIKIDECK_MODES: classic,trending,draft WIKIDECK_GAME_OPERATOR: Testnet C WIKIDECK_GAME_PEERS: http://192.168.1.32:3101,http://192.168.1.32:3102 diff --git a/docs/game/DUEL_API.md b/docs/game/DUEL_API.md new file mode 100644 index 0000000..c9f8d54 --- /dev/null +++ b/docs/game/DUEL_API.md @@ -0,0 +1,89 @@ +# WikiDeck Duel: engine API (v1, Night 2) + +Owner: **duel-core** (claude/wikideck#55). Rules: `docs/game/DUEL_DESIGN.md` (duel-design). This file: how code talks to the engine. +- Types: `shared/duel/types.ts`. Ruleset: `shared/duel/ruleset.ts`. Function surface: `DuelEngineApi` in `shared/duel/index.ts`, implemented by `shared/duel/engine.ts` (engine-alpha PR). +- `shared/game/` (Edit War) is untouched. Change requests: comment on #55 with `[from ]`. + +## Principles +- **Pure and deterministic.** `(rules, decks, seed, actions)` β†’ identical state and log. RNG: `shared/game/rng.ts` (mulberry32); its uint32 state lives in `DuelState.rng`. +- **Plain JSON.** `DuelState` round-trips through `JSON.stringify`/`parse`; `serialize`/`deserialize` are thin wrappers. +- **Clone-on-apply.** `applyAction` never mutates its input and throws on an illegal action. +- **Atomic actions.** `legalActions(state, seat)` is small, and `[]` for the seat that is not to act. The host checks an action by deep-equal against that list (`concede` and `timeout` excepted). +- **Off-chain.** Matches never move or burn cards. Cards arrive derived and frozen; the engine does no I/O. + +## Cards (`DuelCard`) +Built by duel-cards (`derive()`), frozen by the host at match start. Shape agreed with duel-cards on #55. + +| Field | Notes | +|---|---| +| `cardId` | unique in a deck (NFT tokenId; sample id in sims; `token:` for tokens) | +| `pageId`, `revisionId?`, `title`, `description?` | `pageId` matches Linked pairs; `revisionId` for recap references | +| `type`, `subtype?` | `Figure` Β· `Location` Β· `Event` Β· `Institution` Β· `Doctrine` | +| `portal` | `Arts, Earth, History, Science, Society, Neutral`; no deckbuilding restriction | +| `cost` | 1–6 (Locations 1–3) | +| `power`, `toughness` | Figures: body. Locations: 0 / Garrison (0 = can't block). Others: `null` or 0 | +| `keywords` | ≀ `maxKeywords` (2). Figures only | +| `territory?` | Location: +N max Citations while controlled (total from all sources ≀ `territoryCap`) | +| `effects` | `EffectSpec[]` (below), ≀ 4 | +| `rulesText`, `flavor` | display only | +| `connect?` | `{countries, centuries, links, p31}` frozen claims; the engine computes Connected | +| `rarity?`, `deriveVersion?`, `token?` | | + +### Keywords (DUEL_DESIGN Β§4), as the engine applies them +- **Protected**: can't be the target of Events or Doctrines an opponent controls (abilities of other permanents and combat still apply). +- **Featured**: can be blocked only by Featured, Translated or Multilingual Figures. +- **Multilingual**: can block Featured; can't be blocked by Local Figures. +- **Translated**: can block Featured. +- **Legacy**: when destroyed, its controller draws a card. +- **Well-sourced**: prevent the first 1 damage dealt to it each turn. +- **Stub**: at the start of your turn, a +1/+1 counter, up to `stubMax` (2). +- **Local**: +1/+1 while you control a Location sharing a `connect.countries` value. +- **Trending** (Trending mode, set by the host via `applyLive`): no Pending review, +`trendingPower`/+0. + +### Effects (`EffectSpec`) +`{ trigger, op, target?, amount?, power?, toughness?, duration?, token?, condition?, grant?, template? }` +- **Triggers:** `onPlay` (Event resolves; on a permanent same as `onEnter`), `onEnter`, `onAttack`, `onDestroyed`, `startOfTurn`, `onCombatDamageToPlayer` (on a Figure, or on a Doctrine for its attached Figure), `static`. +- **Ops:** `damage`, `damageEach`, `createToken`, `pump`, `fight`, `draw`, `attach`, `gainLife`, `drain`, `destroy`, `bounce`, `tap`. +- **Targets:** chosen: `figure`, `figureOrLocation`, `ownFigure`, `opponentFigure`, `anyTarget`; automatic: `each`, `self`, `attached`, `ownFigures`, `opponentFigures`, `opponent`, `controller`. Defaults: damage β†’ `anyTarget`, pump β†’ `self`, draw/gainLife/createToken β†’ `controller`, drain β†’ `opponent`. +- **Chosen targets:** each `onPlay`/`onEnter` effect with a chosen target consumes the next entry of `play.targets`, in effect order; `legalActions` enumerates the combinations. An Event or Doctrine with no legal target can't be played; a Figure/Location/Institution enters and its targeted effect fizzles (`targets` omitted). +- **fight:** the previous chosen target in the same card (else the source permanent) and this target deal damage equal to their power to each other. T6 = `[{op:'pump', target:'ownFigure', power:k, toughness:0}, {op:'fight', target:'opponentFigure'}]`. +- **Doctrine:** its `attach` effect's target is the Figure it attaches to (`ownFigure` for T11, `figure` for T12). Its `static` effects with `target: 'attached'` apply to that Figure; `condition.samePortal` on a Doctrine means "other Figures you control of the attached Figure's Portal". When the Figure leaves, the Doctrine is Deleted. +- **static pump** applies while the source is in play; conditions use **printed** power (no feedback loops). `condition.connected` = the affected Figure is Connected to the source (T9). +- **createToken:** `amount` tokens of `token` (a fresh `DuelCard` with `token: true`, uid `t:`); `condition.maxTokens` = only if you control fewer tokens than that. Tokens leaving play cease to exist. +- Triggers resolve immediately: the active player's first, then in entry order. + +## Rules (defaults: `DEFAULT_DUEL_RULESET`; details in DUEL_DESIGN Β§2) +- 40-card decks (`deckSize`), ≀ 4 per `pageId`, unique `cardId`s, no tokens. 20 Notability. Drawing from an empty library loses (`libraryEmpty: 'lose'`; `'reshuffle'` and `'fatigue'` exist as data). +- Opening hand 7. Up to `mulligans` (1): shuffle in, draw 7, then on `keep` put one card per mulligan on the bottom (the last in hand order). Seat 0 decides first, then seat 1. +- First player (from the seed) skips their first draw. Balance levers (data only): `firstPlayerDraws`, and `secondPlayerCitations` (extra Citations on the second player's first turn; default 1 from balance v1, #64). +- **Turn:** refresh (base max +1 to 10, plus Territory ≀ 2; refill; untap; Pending review ends; Stub and `startOfTurn` triggers) β†’ draw β†’ **main** β†’ **attack** β†’ **block** β†’ damage β†’ end (damage and "until end of turn" clear; discard down to `handSize` 7, **highest cost first**, automatically). +- Locations: `locationsPerTurn` (1), can't attack. Garrison Locations (toughness > 0) block as 0-power. +- Combat: attack the opponent only; each blocker blocks one attacker, at most one blocker per attacker; simultaneous damage; destroy triggers after all combat damage. No trample, first strike, stack or instants. +- **Connected** (engine, from `connect`, tiers in `connectedTiers`): Linked (either `links` contains the other's `pageId`, or either `cites` contains the other's `qid`), Compatriot (shared country), Contemporary (shared century, different types), Kin (shared P31, not Q5/Q16521). A Figure gets the single best bonus among other permanents its controller controls: `+linkedBonus` (2) if Linked, else `+connectedBonus` (1). Logged once (`connected`). Opposing Connected pairs are logged once as `rivalry`. +- **Timeouts:** `timeout` passes (mulligan: keep; main/attack: end the turn without attacking; block: confirm current blocks). `timeoutsToConcede` (3) consecutive timeouts by one seat lose (`reason: 'timeout'`). +- `turnCap` (default 40 total turns from balance v1, #64; `null` = none): after that many total turns, higher Notability wins, then higher total power in play, then the second player. + +## Phases and actions +| Phase | Who acts | Listed actions | +|---|---|---| +| `mulligan` | seat 0 until ready, then seat 1 | `keep`, `mulligan` | +| `main` | active | `play {uid, targets?}`, `endPhase` | +| `attack` | active | `toggleAttacker {uid}` (untapped, not Pending review, not yet declared), `confirmAttack` | +| `block` | defender | `block {blocker, attacker}` (unassigned blocker, unblocked attacker, evasion allowing), `confirmBlocks` | +| any | either seat | `concede` (not listed) | +| any | host, for the seat to act | `timeout` (not listed) | + +Declarations are **monotonic** (no un-declare), so every turn has a bounded number of actions; UIs stage choices locally and send them on confirm. If the defender has no legal block, damage resolves at `confirmAttack` with no block phase. `confirmAttack` with no attackers ends the turn. + +## Views and log +- `viewFor(state, seat): PlayerView`: your hand; the opponent's hand and library **sizes** only; both graveyards; the battlefield with current power/toughness, keywords and Connected badge; combat; `toAct`; `version`; `result`. Never the RNG or library order. +- **The seed is secret until the match ends.** `seed` plus the deck lists reproduce every shuffle, so the host never sends `seed` or `rng` (or the raw `DuelState`) to clients before `gameOver`. Live log rendering picks template variants from a derived `storySeed = sha256(seed + ':story')`. +- `state.log` is omniscient (server, and the recap after the match). Clients get **`logFor(state, seat)`**: the opponent's `draw` events have no `card`. Every other event is public information. +- Every event has `seq` and `turn`. `CardRef` carries `uid, cardId, title, pageId, type` plus `power`/`toughness` right after the event. +- Kinds (DUEL_DESIGN Β§10 names): `start, mulligan, keep, turnStart, draw, deploy, cast, adopt, tokenCreated, connected, rivalry, effect, attack, block, effectDamage, combatDamage, playerDamage, lifeGain, destroyed, bounced, discard, fatigue, concede, timeout, gameOver`. `destroyed` = the recap's casualties. Prose templates live with duel-design / ui-pvp, not in the engine. + +## Host binding +`duelEnginePort` (engine.ts) is structurally an `EnginePort` (`server/game/engine-port.ts`; `shared/` doesn't import `server/`, so host-pvp types it there). `concedeAction`, `timeoutAction`, `turnSeconds`, `turnOf`, `applyLive` included. `starterDeck` and `previewPool` throw: there are no starters (BRIEF decision 2); draft pools come from both players' collections. + +## Stability +These types are the contract for duel-cards, host-pvp, ui-duel, ui-pvp and sim-balance. Additive changes (optional fields, new log kinds) can land with the engine; breaking ones get a `[duel-core] contract change` comment on #55 first. diff --git a/docs/game/DUEL_BALANCE.md b/docs/game/DUEL_BALANCE.md new file mode 100644 index 0000000..82ab086 --- /dev/null +++ b/docs/game/DUEL_BALANCE.md @@ -0,0 +1,124 @@ +# WikiDeck Duel: balance report + +**Owner:** sim-balance (issue #64). **Rules:** `docs/game/DUEL_DESIGN.md`, `docs/night2/BRIEF.md`. +Every proposal here is **data only**: ruleset keys (`shared/duel` ruleset) or derivation table values (`DERIVE_RULES`). No code changes are proposed in this file. + +## How to reproduce + +``` +# Node 24 (node:24-alpine on r350/inspiron). At most 4 workers on r350 (Night 1 ran out of memory). +npx tsx scripts/sim/duel-run.ts --engine duel --matches 3000 --workers 4 --mix default \ + --out ../sim-out/duel --label base --sha $(git rev-parse --short HEAD) +# Ruleset overrides as JSON (shallow-merged into the duel ruleset): +npx tsx scripts/sim/duel-run.ts --engine duel --rules '{"startingLife":18}' --label life18 ... +``` + +- **Card pool:** the 236 real cards in `docs/game/card-sample.json`, derived by duel-cards (`shared/duel/sample.ts`, `docs/game/duel-card-sample.json`). No chain, no network. +- **Decks:** 120 decks of exactly 40 unique cards (each NFT once), sampled without replacement (`scripts/sim/duel-decks.ts`). Half are uniform random; the rest are skewed archetypes: Figure-, Doctrine-, Event-, Location- and Institution-heavy, low curve and high curve. +- **Bots** (`shared/bots/duel-bots.ts`): `heuristic` (greedy plays on a material evaluation, rule-based attacks and blocks), `mc`/`mc-lite` (shallow Monte Carlo over heuristic rollouts, re-sampling hidden cards on every rollout, so it is not clairvoyant), `greedy` (one-ply) and `random`. Bots see only `viewFor` of their seat. +- **Balance stats use bot-symmetric games only** (both seats the same bot). Mixed pairs measure skill. +- **Card win rate** = win rate of the seat that played the card, in games where only one side played it. It has a positive baseline (winners play more cards), so compare cards against each other and against the "all plays" baseline, not against 50%. +- **Minutes** are a model, not a measurement: 10 s per turn plus 4 s per atomic action (each play, attacker toggle, block and confirm). +- **Connected pair rate** = share of all 27,730 sample pairs with any Connected tier (`connectedTier`). + +## Targets +| Metric | Target | Source | +|---|---|---| +| First-player win rate | 48–54% | DUEL_DESIGN Β§2.6 (issue #64 asks 48–52%) | +| Median game length | 8–12 turns each, 8–15 minutes | issue #64 | +| Stalls | < 5% reach turn 20 each | DUEL_DESIGN Β§2.6 | +| Connected | 15–30% of pairs | BRIEF | +| Famous cards | bigger and pricier, not strictly better: fame vs win rate r β‰ˆ 0 within a cost | BRIEF | + +## Balance v1 (00:05, from the v1 runs below) + +**Ship as ruleset defaults (`DEFAULT_DUEL_RULESET`, data only):** + +| Key | From | To | Why | +|---|---|---|---| +| `secondPlayerCitations` | 0 | **1** | First player 60.1% β†’ **54.7%** [53–57] (v1-cand, nβ‰ˆ2700). The edge is tempo, and this is the only lever that moved it. | +| `turnCap` | null | **40** (20 each) | Games past 20 turns each 3.4% β†’ **0%**. 3.9% of games are decided at the cap; median and p90 unchanged (8 / 12). | + +v1-cand (both changes, 3000 matches, engine 4623930 + duel-cards 067de83): first player 54.7% [53–57], turns each 6 / 8 / 12, est. minutes median 7.9 / p90 13.5, 0 library-outs, Connected 17.2% of pairs. + +The first-player rate sits at the top edge of DUEL_DESIGN's 48–54% band (issue #64 asked for 48–52%). `secondPlayerCitations: 2` was not tested; duel-design prefers to accept ~54% over a 2-Citation swing. + +**Landed:** duel-core set both as `DEFAULT_DUEL_RULESET` values on `engine-wip` 0eb80d2. night-review's random-play soak there (300 matches) gives a first-player rate of 51.0%, down from 62.7%, with 0 leaks, exact replay, and `turnCap` ending forced stalls at turn 40. duel-design recorded both in DUEL_DESIGN v1.3 (#66). + +**Not shipped, with the evidence:** +- Second seat +1 opening card: no effect (60.7%); the mulligan and the 7-card hand limit absorb it. +- `garrisonStep` 15: Location-heavy decks +4 pts, but games get longer (p90 14, 4.5% past 20 turns). +- `territoryCap` 3, `locationsPerTurn` 2, `stubMax` 1, `startingLife` 16/24: ≀ Β±3 pts on first player or Location decks. +- `libraryEmpty: reshuffle`: games stretch out (the run didn't finish in 9 min); BRIEF keeps the MTG rule. +- `firstPlayerDraws: true`: worsens the edge (+1.7 pts). + +**Open for v1.1: Locations.** Location-heavy decks win ~17–21% in every variant, and Location cards are the weakest type (47–48%). The T2 rider "When this enters, draw a card" (v1-cand-ld) raises the Location card to 51.7% but does **not** help Location-heavy decks (16.5%), pushes the first player back to 58.4%, and brings back library-outs (117 of 3000). It needs another lever first, e.g. the conditional version ("if you already control 2 or more Locations") or a Location body (`garrisonStep`) change, tested together with spc1. Since random collections are ~32% Locations, this matters for real players. + +**Healthy, leave alone:** Connected (17.2% of pairs, fires on 28% of plays, inside 15–30%). Famous cards are bigger, not strictly better: fame vs card win rate r = 0.10–0.20 overall, β‰ˆ0 or negative within a cost. Keywords all net positive; Featured strongest, kept per duel-design. + +## Frozen head (01:15) + +**Not run.** At the 01:15 freeze `night/2026-11-17` was still at 2af2e7f: no PR had merged all night (night-lead unreachable, see #53), so there was no frozen head containing the duel engine. The reference result is therefore **v1-cand at engine-wip 4623930 + duel-cards 067de83 (not frozen head)**. At 01:16 the newest unmerged heads were: engine-wip 0eb80d2 (balance v1 as defaults), duel-cards 5076299, duel-adapter d97cbc2. Once they merge, re-run with no overrides: +``` +npx tsx scripts/sim/duel-run.ts --engine duel --workers 4 --mix fast --matches 3000 --label frozen --sha $(git rev-parse --short HEAD) +``` + +## Results + +### v1 runs: engine-wip 4623930 + duel-cards 067de83 (Doctrines working) +Run by ui-duel on inspiron-3670 with this harness (duel-adapter acd2c49/7102239), Node 24, 4 workers, `--mix fast`, 120 decks. Not yet the frozen head; see "Frozen head" below. + +| Run | Overrides | n | First player (sym) | Turns each p10/med/p90 | >20 turns each | Library-out | Loc-heavy | Doc-heavy | Fig-heavy | +|---|---|---|---|---|---|---|---|---|---| +| v1-base | `{}` | 3000 | **60.1%** [58–62] | 6 / 8 / 12 | 3.4% | 2.0% | 20.5% | 42.8% | 66.6% | +| v1-spc1 | `{"secondPlayerCitations":1}` | 1500 | **54.4%** [52–57] | 6 / 8 / 12 | 3.9% | 2.2% | 20.8% | 45.9% | 63.0% | +| v1-extra1 | second seat +1 opening card (sim-only hook) | 1500 | 60.7% [58–63] | 6 / 8 / 12 | 3.6% | 2.3% | 16.8% | 52.9% | 64.7% | +| v1-garr15 | derive `garrisonStep` 15 | 1500 | 58.5% [56–61] | 6 / 8 / 14 | 4.5% | 2.3% | 24.9% | 45.3% | 65.3% | +| v1-terr3 | `{"territoryCap":3}` | 1500 | 59.7% [57–62] | 6 / 8 / 12 | 3.0% | 1.9% | 21.3% | 49.4% | 64.7% | +| v1-cap40 | `{"turnCap":40}` | 1500 | 60.2% [58–63] | 6 / 8 / 12 | 0.0% | 0 (turnCap 3.1%) | 19.8% | 48.3% | 65.9% | +| **v1-cand** (3000) | `{"secondPlayerCitations":1,"turnCap":40}` | 3000 | **54.7%** [53–57] | 6 / 8 / 12 | 0.0% | 0 (turnCap 3.9%) | 17.9% | 41.7% | 64.2% | +| v1-cand-ld (3000) | v1-cand + every Location "When this enters, draw a card" | 3000 | 58.4% [57–60] | 6 / 8 / 12 | 0.0% | 3.9% (turnCap 0.4%) | 16.5% | 39.0% | 62.5% | +| v1-combo | garr15 + `{"secondPlayerCitations":1,"territoryCap":3,"turnCap":40}` | 1500 | **52.8%** [50–55] | 6 / 8 / 13 | 0.0% | 0 (turnCap 4.4%) | 21.3% | 43.0% | 61.8% | + +Card type WR (seat that played it), v1-base β†’ v1-combo: Doctrine 55.8 β†’ 56.4, Event 51.1 β†’ 51.8, Figure 58.8 β†’ 58.4, Institution 53.1 β†’ 52.8, Location 48.1 β†’ 48.0. Est. minutes v1-combo 5.6 / 8.4 / 14.9. + +v1-base other numbers: est. minutes 5.4 / 7.9 / 13.2; Connected 17.2% of pairs, 28.1% of plays (6.96 per game); fame vs card WR r = 0.20 (top vs bottom decile 62.1% vs 53.6%, both above the played-card baseline); card type WR Doctrine 55.8%, Event 51.1%, Location 48.1%. + +### Old-tree sweep (engine 5cd0ffb + duel-cards ae14bc7, Doctrines inert): relative effects only +| Run | Overrides | First player | Turns each p10/med/p90 | >20 turns | Loc-heavy | Doc-heavy | Fig-heavy | +|---|---|---|---|---|---|---|---| +| alpha-base (4000) | `{}` | 57.8% [56–59] | 6 / 8 / 21 | 10.3% | 23.2% | 29.5% | 73.1% | +| p1draws | `{"firstPlayerDraws":true}` | 59.5% [57–62] | 6 / 8 / 19 | 9.4% | 24 | 27 | 74 | +| life24 | `{"startingLife":24}` | 55.0% [52–58] | 6 / 9 / 24 | 12.2% | 21.8% | 29.7% | 72.3% | +| life16 | `{"startingLife":16}` | 57.3% [55–60] | 5 / 8 / 16 | 7.7% | 27.9% | 29.1% | 68.2% | +| terr3 | `{"territoryCap":3}` | 56.0% [53–59] | 6 / 8 / 18 | 9.3% | 23.9% | 30.2% | 71.1% | +| loc2 | `{"locationsPerTurn":2}` | 55.1% [52–58] | 6 / 8 / 20 | 9.8% | 24.4% | 29.1% | 71.1% | +| stub1 | `{"stubMax":1}` | 55.0% [52–58] | 6 / 8 / 17 | 7.7% | 20.3% | 30.8% | 68.2% | +| reshuffle | `{"libraryEmpty":"reshuffle"}` | stopped after 9 min: games stretch out | | | | | | + +### Baseline, engine alpha (duel-core `engine-wip` 5cd0ffb + duel-cards ae14bc7, merged locally). Not the frozen head. + +> **Superseded:** at duel-cards ae14bc7 Doctrines attached but gave no Β±k (fixed in 067de83). Doctrine numbers below are therefore wrong, and everything else is slightly off. See the v1 runs. +4000 matches, `--mix fast` (90% heuristic mirrors, 5% heuristic vs random, 5% heuristic vs greedy), 120 decks, 0 engine errors. + +| Metric | Value | Target | +|---|---|---| +| First-player win rate | **57.8%** [56–59] | 48–52% | +| Turns each p10 / median / p90 | 6 / **8** / 21 | 8–12 | +| Est. minutes p10 / median / p90 | 5.6 / 8.6 / 20.3 | 8–15 | +| Games past 20 turns each | **10.3%** | < 5% | +| Library-out losses | 7.2% (70% of the long games) | | +| Connected pair rate / fires per play | 17.2% / 28% | 15–30% | +| Fame vs card WR within each cost | r = βˆ’0.24, βˆ’0.65, βˆ’0.54, +0.12, βˆ’0.14, +0.07 (costs 1–6) | β‰ˆ 0 | +| heuristic vs greedy / random | 72.9% / 95.1% | | + +**Findings** +1. **First-player edge is tempo.** 68.5% in games under 7 turns each, 57% at 7–9, ~54% in longer games. `firstPlayerDraws: true` raises it to 59.5% (1500 matches), so the edge needs compensation for the second seat, not a draw change. +2. **Deck composition dominates.** Win rate vs decks without the tag: Figure-heavy 73%, random 67%, high-curve 46%, Event-heavy 44%, Institution-heavy 37%, low-curve 35%, Doctrine-heavy 30%, Location-heavy **23%**. By card type (seat that played it): Figure 58.8%, Institution 51.3%, Event 50.2%, Doctrine 47.3%, Location 47.1%. Every one of the 8 bottom cards is a Location: past the 2-Territory cap a Location is only a 0/1–0/4 Garrison. Random collections are ~32% Locations (75 of 236), so this matters for real players, who can't choose what they mine. +3. **Famous cards are not strictly better.** Within a cost, fame and win rate are uncorrelated or negative (the keyword tax). Cost-6 cards win 61% when played, but that includes a survivorship effect (you only reach 6 Citations in longer games you're still in). +4. **Keywords are all net positive.** When played: Featured 67.6%, Multilingual 67.6%, Well-sourced 59.6%, Protected 59.2%, Translated 59.0%, Legacy 58.6%, Stub 58.2%, Local 54.6%, none 48.6%. Featured is the strongest relative to its tax. +5. **Long games** are not mainly Location decks: past 20 turns each in 16% of low-curve games, 13% random, 11% Location-heavy, 3% Event-, Institution-heavy and high-curve. Boards stall and decks run out. + +Caveats: the heuristic bot may under-use Doctrines and Events, and may be too cautious to attack into walls (the MC-mirror check was stopped, see below), so the Doctrine/Event numbers and the stall rate are upper bounds on the problem. + +The sweep on r350 was stopped at 23:00 when r350 ran out of memory; ui-duel re-ran it on inspiron (tables above). diff --git a/docs/game/DUEL_DESIGN.md b/docs/game/DUEL_DESIGN.md new file mode 100644 index 0000000..fe4d5f3 --- /dev/null +++ b/docs/game/DUEL_DESIGN.md @@ -0,0 +1,279 @@ +# WikiDeck Duel: design v1 + +**Status:** v1.3, Night 2 (2026-11-17): v1 plus night-review's nits on PR #66, duel-cards' implementation choices from PR #70, and the balance v1 rules `secondPlayerCitations` 1 and `turnCap` 40 (#64). Owner: duel-design (issue #60). +**Base:** `docs/night2/BRIEF.md` (Eric's locked decisions). Where this file and BRIEF disagree, BRIEF wins. Reviews used: designer (rules), data Β§2–4 (derivation), critic S7 (tone). +**Consumers:** duel-core (`shared/duel/` engine and `types.ts`), duel-cards (`classify/derive/effects/text.ts`), sim-balance (bots, `DUEL_BALANCE.md`), ui-duel / ui-pvp (faces, recap), host-pvp (rulesets). + +Every number in this file is a **ruleset key or a derivation table value**, not code. sim-balance tunes them in data-only PRs. + +--- + +## 1. The game in one paragraph +Two players each bring **40 cards they own on-chain**. Each card is a Wikipedia article turned into a Magic-style card by fixed rules over real data. You start at **20 Notability**. Every turn your **Citations** (mana) maximum rises by one. You deploy Figures, attack with them, block with yours, cast Events, adopt Doctrines onto Figures. The first player to 0 Notability, or unable to draw, loses. The match is written up afterwards as an encyclopedic "Battle of X (2026)" page. + +--- + +## 2. Rules + +### 2.1 Decks and eligibility (BRIEF decisions 1–2) +| Key | Default | Rule | +|---|---|---| +| `deckSize` | **40** | Exactly this many cards. Every card is an NFT the player owns (server-verified by `ownership.ts`). No Basics, loaners, proxies or tokens in decks. | +| `maxCopiesPerPage` | **4** | Different mints of the same `pageId` may appear up to 4 times (each mint once: it is unique). | +| colour/Portal rules | none | Any mix of Portals. | +| Eligibility | owns β‰₯ `deckSize` | Below it, the UI shows "23 / 40 cards" and how to mine. No practice with borrowed cards. Bot matches need eligibility too. | + +Testnet end-to-end mode files may lower `deckSize`. Production stays at 40. + +### 2.2 Setup +- **Notability** (life): `startingLife` **20**. At 0 you lose. +- **Empty library:** drawing from an empty library loses (`libraryEmpty: 'lose'`). +- **Opening hand:** `openingHand` **7**. One mulligan (`mulligans: 1`): shuffle, draw 7, put 1 on the bottom. +- **First player** (seeded coin flip) skips their first draw. +- **Second player** gets +1 Citation maximum on their first turn only (`secondPlayerCitations` **1**). Balance v1: this moved the first-player win rate from 60.1% to 54.4% in 1,500 heuristic-mirror matches (engine 4623930, #64). Neither an extra opening card (washed out by the mulligan and the hand limit) nor `firstPlayerDraws` worked. + +### 2.3 Turn structure: refresh β†’ draw β†’ main β†’ combat β†’ end +1. **Refresh.** Citation maximum +1 (to `maxCitations` **10**), plus Territory (Β§2.5). Citations refill to the maximum. Your permanents untap. "Pending review" ends for your Figures. Start-of-turn triggers (Stub, Institutions) resolve in the order the permanents entered. +2. **Draw** 1 card. +3. **Main.** Play cards in any order while you can pay their cost in Citations: Figures, Locations (one per turn: `locationsPerTurn` 1), Institutions, Doctrines (attach to a Figure), Events (resolve immediately). +4. **Combat** (Β§2.4). +5. **End.** Damage on permanents clears. "Until end of turn" effects end. Discard down to `handLimit` **7** (the player chooses; bots discard highest cost first). + +**Zones.** Library and hand are hidden (a hand's size is public). The battlefield and **Deleted** (the graveyard) are **public**: a discarded card is revealed and named once it reaches Deleted. + +There is **no second main phase, no stack, no priority and nothing at instant speed.** Events are sorcery-speed. Triggers resolve immediately, in a fixed order: the active player's first, in the order the cards entered. + +### 2.4 Combat +- **Attack:** the active player chooses any untapped Figures without Pending review and taps them. They attack the opponent only, never permanents. +- **Block:** the defender assigns **at most one blocker per attacker**, and each blocker blocks one attacker. Untapped Figures and Garrison Locations may block. Evasion (Featured) restricts who may block: **a Garrison Location can't block a Featured attacker** (only Featured, Translated or Multilingual Figures can). +- **Damage:** simultaneous. A blocked pair deal their power to each other. An unblocked attacker deals its power to the defending player's Notability. +- A permanent with damage β‰₯ toughness is **destroyed** (goes to the Deleted pile, the graveyard). Destroy triggers (Legacy) fire after all combat damage. +- No trample, no first strike, no deathtouch, no lifelink in v1. + +### 2.5 Card types (BRIEF; classifier in data Β§1, built by duel-cards) +| Type | MTG analogue | Rules | +|---|---|---| +| **Figure** | creature | Power/toughness. Enters with **Pending review** (summoning sickness): can't attack until your next turn. | +| **Location** | land-ish permanent | Cost `ceil(derivedCost/2)` (1–3). **Territory:** +1 Citation maximum while you control it; at most **+2 in total** from Territory (`territoryCap` 2). **Garrison 0/T:** can block like a 0-power Figure (T = 1 + floor(pct_depth / 25), so 1–4). Can't attack. Damage clears at end of turn as usual; a Location destroyed in a block goes to Deleted. One per turn. | +| **Event** | sorcery | Resolves at once, then goes to Deleted. | +| **Institution** | artifact | A permanent with a static or triggered ability. | +| **Doctrine** | Aura | **Adopt:** attach to target Figure (yours or the opponent's for negative Doctrines). If the Figure leaves play, the Doctrine goes to Deleted. | + +Classification order (duel-cards owns it): P31 β†’ P279 anchor classes β†’ P31 label regex (`^human$`, fixing the `\bhuman\b` bug) β†’ categories β†’ description β†’ **Doctrine**. The derived profile is **frozen** the first time a card is seen. + +### 2.6 Clock and length +- `turnSeconds` **60** per turn plus `bankSeconds` **300** per player. The turn timer runs first; when it expires, the player's bank drains; when the bank is also empty, the turn passes (`timeout` action). The bank does not refill. Three timeouts in a row concede. +- **`turnCap` 40** (20 turns each, balance v1). At the cap the higher Notability wins, then the higher total power in play, then the second player. In sims it decides about 4% of games and removes every game past 20 turns each, without moving the median. +- **Sim targets** (agreed with sim-balance, #64): median 8–12 turns each; first-player win rate 48–54%; < 5% of games past 20 turns each. **Balance v1 result** (`secondPlayerCitations` 1 + `turnCap` 40; 3,000 heuristic-mirror matches, engine 4623930, duel-cards 067de83; run by ui-duel for sim-balance, #64): first player **54.7%** [53–57], turns each 6 / 8 / 12, 0% past 20, about 8 minutes median. + +### 2.7 Determinism +All randomness (shuffles, coin flip, template variants) comes from the match seed via `shared/game/rng.ts`. The same seed and actions always replay to the same state, log and recap. + +--- + +## 3. Derivation summary (duel-cards implements; data Β§2) +- **Percentiles** `pct_a`, `pct_d`, `pct_r` from the sample cut points (DESIGN.md Β§1.1 counting). **fame** = mean of the three, rounded. +- **Cost** 1–6 by `costThresholds` [26, 39, 51, 63, 78]. +- **Figure body budget** P+T = [3, 4, 6, 8, 10, 12] for cost 1–6 (MTG vanilla curve). Subtract **1 per taxed keyword** (Β§4). At cost 1, a second taxed keyword is skipped, so a body never drops below 1/1. Then `power = clamp(round(budget Γ— pct_a / (pct_a + pct_d)), 1, budget βˆ’ 1)`, toughness = the rest. Famous cards are bigger and pricier, never more efficient. +- **Magnitude** for non-Figures: `k = ceil(cost / 2)` (1–3). +- **Portal** (faction): Arts, Earth, History, Science, Society, or Neutral, scored by regex hits (designer Β§3.2); ties go to the type default (Figure β†’ Society, Location β†’ Earth, Event β†’ History, Institution β†’ Arts, Doctrine β†’ Science). No deckbuilding restriction. +- **Flavour text:** first sentence of on-chain `article.extract`; if absent (the sample has none), the Wikidata `description`; if that is empty too, none. + +--- + +## 4. Keywords (10) +Eight card keywords, each triggered only by real data and applied **to Figures only**, at most **2 per card** in the priority order below. Plus two rules keywords. Thresholds are measured on the 236-card sample (86 Figures); sim-balance may move them. + +| # | Keyword | Trigger (real data) | Rules text | Body tax | Rate among Figures | +|---|---|---|---|---|---| +| 1 | **Protected** | category `Living people` | Can't be the target of Events or Doctrines an opponent controls. | 1 | 38% | +| 2 | **Featured** (flying) | pct_attention β‰₯ 85 | Can't be blocked except by Featured, Translated or Multilingual Figures. | 1 | 15% | +| 3 | **Legacy** | a ` deaths` category (or P570 in the frozen profile) | When this is destroyed, draw a card. | 1 | 33% | +| 4 | **Multilingual** | pct_reach β‰₯ 90 | Can block Featured Figures. Can't be blocked by Local Figures. | 1 | ~5% | +| 5 | **Translated** (reach) | 75 ≀ pct_reach < 90 | Can block Featured Figures. | 0 | 19% | +| 6 | **Well-sourced** | pct_depth β‰₯ 85 | Prevent the first 1 damage that would be dealt to this each turn. | 1 | ~13% before cap | +| 7 | **Stub** | pageBytes < 3000 or a `…stubs` category | At the start of your turn, put a +1/+1 counter on this, to a maximum of 2. | 0 | 33% | +| 8 | **Local** | raw reach = 0 (no other language editions) | Gets +1/+1 while you control a Compatriot Location (same P17). | 0 | 7% before cap | +| 9 | **Connected** | the card pair's frozen claims and links (Β§6) | +1/+1 while you control another card Connected to it; +2/+2 if Linked. | – | target 15–30% of pairs | +| 10 | **Trending** (haste) | Trending mode only: frozen live β–² (trend β‰₯ +25% and daily β‰₯ 20) | Can attack the turn it enters. Gets +1/+0. | – | ~2% of cards | + +Rule words that are not keywords: **Pending review** (summoning sickness), **Territory**, **Garrison**, **Adopt**, **Deleted** (the graveyard). + +Notes: +- Protected deliberately sits first: living people are the most targeted, and the rule that matters most for them is mechanical, not a tone rule. It doesn't stop combat. +- Multilingual and Translated are two bands of the same reach axis, so a card never has both. +- A card's face shows at most 2 keyword words; the reminder text is behind a tap. + +--- + +## 5. Effect templates (12, MTG register) +Subtype regexes run over the frozen P31/P279 labels, then the description, then categories. First match wins, in the order listed. `k = ceil(cost/2)`. + +| # | Type / subtype | Trigger regex (labels, description) | Rules text | +|---|---|---|---| +| T1 | Figure | (all Figures) | Vanilla body + keywords. No other text. | +| T2 | Location | (all Locations) | Territory. Garrison 0/T. | +| T3 | Event: conflict | `battle\|war\|siege\|annexation\|protest\|riot\|uprising\|massacre\|coup` | Deal k+1 damage to target Figure or Location. | +| T4 | Event: disaster | `storm\|nor.easter\|cyclone\|hurricane\|earthquake\|flood\|tornado\|wildfire\|eruption\|famine\|epidemic` | Deal kβˆ’1 damage (minimum 1) to each Figure and each Location. | +| T5 | Event: election | `election\|referendum\|straw poll` | Create k 1/1 Society Figure tokens named Elected Member. | +| T6 | Event: sport | `match\|final\|season\|tournament\|championship\|grand prix\|race` | Target Figure you control gets +k/+0 until end of turn, then fights target Figure you don't control. | +| T7 | Event: default (period, ceremony, scandal, other) | anything else | Draw k cards. | +| T8 | Institution: organisation | `company\|organi[sz]ation\|party\|agency\|studio\|military\|university\|diocese\|council\|band\|musical group\|association\|business\|school\|college\|institute\|manufacturer` | Cost β‰₯ 4: "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member." Cost ≀ 3: "When this enters, create a 1/1 Figure token named Staff Member." | +| T9 | Institution: creative work | `film\|album\|song\|book\|novel\|series\|video game\|painting\|software\|typeface\|newspaper\|magazine` | When this enters, draw a card. Figures you control that are Connected to this get +1/+1. | +| T10 | Institution: team, award, vehicle, other | anything else | Figures you control with power 2 or less get +1/+0. | +| T11 | Doctrine: Adopt | (all non-Pathology Doctrines) | Attach to target Figure you control. It gets +k/+k. Rider by subtype, checked in the order pathology (β†’ T12) > language/software > mathematics, so "functional programming language" is not maths: mathematics β†’ "and has Well-sourced"; language/software β†’ "Whenever it deals combat damage to a player, draw a card"; ideology/religion β†’ "Other Figures you control of its Portal get +1/+0"; otherwise none. | +| T12 | Doctrine: Pathology | `disease\|clinical sign\|pathogen\|syndrome\|disorder\|toxin\|poison` | Attach to target Figure. It gets βˆ’k/βˆ’k. | + +Elected Member tokens are Society; Staff Member tokens have no Portal ("1/1 Figure token"). Tokens are not cards: they never appear in decks, are created only by T5/T8, and are removed when they leave play. Token names are fixed generic strings, never real people. + +Rules-text style: +- Second person, present tense, MTG terse register: "Deal 3 damage to target Figure." +- Card names appear in rules text only as "this" (never the article title), so text stays the same length on a 360 px face. +- No adjectives, no puns, no exclamation marks. + +--- + +## 6. Connected (data Β§4 tiers) +Computed by the host at match start from frozen card profiles. No network calls during a match; the edge list is written into the match record. + +| Tier | Test | Bonus | Cut order | +|---|---|---|---| +| **Linked** | either article links to the other (cached outlinks), or one card's claims cite the other's Q-id | +2/+2 | keep | +| **Compatriot** | share a P17 (country) or P27 (citizenship) value | +1/+1 | keep | +| **Contemporary** | same century from P569/P570/P571/P580/P585, **only between different types** | +1/+1 | cut 4th (BRIEF) | +| **Kin** | same P31 class, excluding Q5 human and Q16521 taxon | +1/+1 | cut 4th (BRIEF) | + +- A Figure gets the **single best** bonus among its Connected cards you control (no stacking): +2/+2 if any is Linked, else +1/+1. +- A Connected creative-work Institution (T9) gives its +1/+1 on top. +- **Target:** 15–30% of random card pairs connected (text proxies measured 21.5% for country OR century). If sims show more, drop the noisiest keys first (P17 = United States, then France); if fewer, add P131. +- The card shows why: "Connected β€” *Pathrail Mosque* (country: Bangladesh)". +- **Rivalry** (log only): when two opposing cards are Connected, the log may note it once (Β§8.3). No mechanical effect. + +--- + +## 7. Modes (on the duel engine) +| Mode | Decks | Notes | +|---|---|---| +| **Classic** | constructed from your own 40+ owned cards | Ranked (Elo, keyed to the eom.dev account). Invite links and quick match. | +| **Bot** | your own 40 | Only for eligible players. Not ranked. | +| **Draft** | both players eligible | Pool drawn from both players' collections (e.g. 30 cards from each, shuffled into one pool). Snake-pick until each has `deckSize`. Drafted cards are used for that match only; nothing moves on-chain. Ownership is credited in the recap ("from the collection of bob"). | +| **Trending** | any | Live pageview trend from the daily cache, frozen at match start: β–² (β‰₯ +25%, daily β‰₯ 20) gives Trending (haste, +1/+0); β–Ό (≀ βˆ’50%, daily β‰₯ 20) gives βˆ’1/βˆ’0. Cut 3rd. | +| **House rules** | peer-hosted | Data-only, versioned schema. Keys: `deckSize`, `maxCopiesPerPage`, `startingLife`, `openingHand`, `mulligans`, `maxCitations`, `territoryCap`, `handLimit`, `turnSeconds`, `bankSeconds`, `turnCap`, `secondPlayerCitations`, `connectedTiers`, `keywordThresholds`. Night 1 mode files are rejected cleanly with a message. | + +--- + +## 8. Tone and story text + +### 8.1 Tone rules (BRIEF decision 5, critic S7) +1. **Lean in.** Living people, tragedies, wars, disasters, crimes, diseases and dictators are ordinary cards with full mechanics. No `solemn` flags, no special cases, no softened verbs. "Casualties" is fine. A protester shot in 1970 is a 6/3 with Legacy like anything else. +2. **Deadpan.** The text takes itself completely seriously. It **never winks** and **never comments on the matchup** ("in a surprising twist", "unlikely", "ironically" are banned). The comedy lives in the nouns: "*Heart rot* was adopted by *Tom Ewell*." +3. **Encyclopedic texture.** Past tense, third person, passive where Wikipedia would use it, dates and turn numbers, and `[n]` citations linking each card's real article at its revision. +4. **No adjectives about cards or players** (no "brutal", "heroic", "humiliating", "bloodiest"). Mechanical verbs only: deployed, attacked, blocked, was destroyed, was adopted by, took N damage, was cited. +5. **Never invent facts about real people.** All generated text is a deterministic template filled **only** with real card data (title, description, dates, categories, revision id) and real match data (turn, players, numbers). No LLM prose. No made-up quotes, crimes, acts, motives or feelings. The template verbs describe **game events of the card**, and every narrative paragraph is framed as a WikiDeck engagement; the footer says so. +6. **Allowed real data in text:** title, Wikidata `description`, birth/death years parsed from the description or frozen claims, the first extract sentence (flavour), Portal, type. Nothing else about a person. +7. **Dull guard:** 3–4 synonymous variants per event, chosen by the match seed (Β§8.2). + +| DO | DON'T | +|---|---| +| "Turn 6. *Zbyszek Godlewski* (6/3) attacked. *Pallas's cat* (5/5) blocked. *Zbyszek Godlewski* was destroyed.[3][4]" | "Godlewski got mauled by a cat lol" | +| "The *April 2021 nor'easter* dealt 1 damage to each Figure. *Dichromorpha viridis* was destroyed.[5][6]" | "Mother Nature wiped out the poor grasshopper!" | +| "*Heart rot* was adopted by *Tom Ewell*, which became a 2/2.[7][8]" | "Ewell caught a tree disease, how embarrassing" (adjective + invented claim) | +| "The **Battle of Pathrail Mosque (2026)** was a WikiDeck engagement fought on 17 November 2026 between the forces of alice and bob." | "the bloodiest battle in WikiDeck history" | + +### 8.2 Match-log templates (`shared/duel/story/log.ts`) +- One template group per engine `LogEvent` kind, each with **3–4 variants**. Variant = `rng(seed, turn, eventIndex) mod n`, using the match seed, so `replay` regenerates the log exactly. +- First mention of a card in a match adds its description in parentheses: "*Tom Ewell* (American actor, 1909–1994)". Later mentions use the title only. +- Each first mention of a card assigns it the next reference number `[n]`; later mentions reuse it. +- `logFor(seat)` hides the opponent's hand: their draws read "bob drew a card." and mulligans are not named. Discards are named, because Deleted is public (Β§2.3). + +| Event | Variants (`{card}` italic, `{player}` the seat name) | +|---|---| +| deploy (Figure/Location/Institution) | "{player} deployed {card}." Β· "{card} was deployed by {player}." Β· "{player} brought {card} into play." Β· "{card} entered play under {player}." | +| event cast | "{player} cited {card}." Β· "{card} was cited by {player}." Β· "{player} invoked {card}." | +| adopt | "{doctrine} was adopted by {figure}, which became a {p}/{t}." Β· "{figure} adopted {doctrine} and became a {p}/{t}." Β· "{player} attached {doctrine} to {figure} ({p}/{t})." | +| attack | "{card} ({p}/{t}) attacked." Β· "{player} sent {card} ({p}/{t}) into combat." Β· "{card} ({p}/{t}) advanced on {opponent}." | +| block | "{blocker} ({p}/{t}) blocked {attacker}." Β· "{attacker} was blocked by {blocker} ({p}/{t})." Β· "{blocker} ({p}/{t}) intercepted {attacker}." | +| player damage | "{opponent} lost {n} Notability ({life} remaining)." Β· "{card} dealt {n} damage to {opponent}, leaving {life} Notability." Β· "{opponent}'s Notability fell to {life}." | +| destroyed | "{card} was destroyed." Β· "{card} was moved to Deleted." Β· "{card} was removed from play." Β· "{card} did not survive the turn." | +| effect damage | "{source} dealt {n} damage to {target}." Β· "{target} took {n} damage from {source}." Β· "{source} inflicted {n} damage on {target}." | +| token created | "{source} produced {n} {token}." Β· "{n} {token} were created by {source}." Β· "{source} created {n} {token}." | +| draw (own) | "{player} drew {card}." Β· "{card} was drawn." Β· "{player} added {card} to their hand." | +| draw (hidden) | "{player} drew a card." Β· "{player} drew {n} cards." | +| Connected | "{a} and {b} were Connected ({reason})." Β· "{a} was Connected to {b} through {reason}." Β· "Records link {a} and {b} ({reason})." | +| discard | "{player} discarded {card}." Β· "{card} was discarded by {player}." Β· "{player} moved {card} from hand to Deleted." | +| rivalry (opposing Connected pair, once) | "{a} and {b} are both listed under {reason}." Β· "{a} and {b} share {reason}." Β· "The two sides were linked through {reason}." | +| turn start | "Turn {n}." (fixed) | +| game over | "{loser} was nominated for deletion. The result was **delete**." Β· "{loser} was reduced to 0 Notability. {winner} won." Β· "{winner} won on turn {n}." Β· (library) "{loser} could not draw a card and lost." Β· (concede) "{loser} withdrew." | + +### 8.3 Battle recap (`shared/duel/story/recap.ts`) +A deterministic function `recap(matchRecord) β†’ RecapDoc` (structured data; ui-pvp renders it). Inputs are the match record only: seed, players, decks' frozen card profiles, the event list, the date. No network, no clock. + +**Title:** "{Prefix} {Name} ({year})" +- **Name:** the winner's highest-cost Location that entered play; else the loser's; else the highest-cost Event cast in the match; else the winner's highest-cost card deployed; ties broken by first played. Living people and tragedies are eligible like any card ("Battle of Zbyszek Godlewski (2026)" is valid). +- **Prefix:** "Skirmish at" (≀ 6 turns each), "Battle of" (7–12), "Siege of" (β‰₯ 13). For a Figure name: "Battle of" becomes "{Name} campaign" (no prefix). +- **Year:** the match date's year (2026). + +**Infobox:** +| Field | Value | +|---|---| +| Date | the match date, "17 November 2026" | +| Location | the Name card if it's a Location, else "WikiDeck host {hostName}" | +| Result | "Decisive {winner} victory" (margin β‰₯ 10 Notability) Β· "Pyrrhic {winner} victory" (winner ≀ 3) Β· "{winner} victory" Β· "{winner} victory by withdrawal" (concession/timeout) Β· "{winner} victory by attrition" (empty library) Β· "Victory by decision" (turn cap) | +| Belligerents | the two seat names (account display names) | +| Commanders | each side's highest-cost Figure deployed | +| Strength | cards deployed per side ("14 cards") | +| Casualties and losses | cards destroyed per side, count, then the titles | + +**Sections:** +1. **Lead** (1 paragraph): "The {title} was a WikiDeck engagement fought on {date} between the forces of {a} and {b}. It lasted {n} turns and ended in {result-lowercase}.[1]" + one sentence on the first Figure deployed: "Contemporary accounts note the deployment of {card} in the {ordinal} turn.[n]" +2. **Background:** each side's Portal mix ("History was the largest Portal in the force of alice (eleven of twenty cards played)"). +3. **Course of the battle:** the 3–5 largest Notability swings and every destroyed card with cost β‰₯ 4, in turn order, as log sentences (variants from Β§8.2, but seeded with `seed βŠ• 'recap'` so the recap doesn't repeat the log word for word). +4. **Aftermath:** final Notability, turns, rating change if ranked. +5. **See also:** Connected pairs and rivalries. +6. **References:** every card played by either side, in first-mention order: "{n}. ^ "{title}". Wikipedia. Revision {revisionId}. Minted as token {tokenId}." linking `https://en.wikipedia.org/w/index.php?title={title}&oldid={revisionId}`. + +**Branding and footer:** WikiDeck masthead, never the Wikipedia/Wikimedia name or logo. Footer: "This page records a WikiDeck match. Card names refer to Wikipedia articles; the events described are game events." Shareable at `/recap/{matchId}`. + +--- + +## 9. Worked examples (12 cards from `docs/game/card-sample.json`) +Computed with the rules above (data Β§2 budget, Β§4 keyword priority, Β§5 templates) by a script over the sample, and checked by hand. duel-cards' implementation (PR #70) agrees on all 12, with the two Portal corrections now applied (#9, #11). Flavour is the `description` because the sample has no extracts. Final numbers come from duel-cards' implementation; if they differ, the implementation and its golden test win and this table is updated. + +| # | Card | Derivation | Card | +|---|---|---|---| +| 1 | **Marc Fesneau** (living person) | P31 human β†’ Figure. "politician" β†’ Society. pct 76/68/63 β†’ fame 69 β†’ cost 5, budget 10. Living people β†’ Protected (βˆ’1) β†’ 9 split 76:68 β†’ 5/4. | **Marc Fesneau** Β· 5 Β· Figure β€” Society Β· **5/4** Β· *Protected.* "French politician (born 1971)." | +| 2 | **Tom Ewell** | human β†’ Figure, Arts. 94/83/93 β†’ fame 90 β†’ cost 6, budget 12. Featured (βˆ’1), Legacy (βˆ’1); Multilingual dropped by the cap. 10 β†’ 5/5. | **Tom Ewell** Β· 6 Β· Figure β€” Arts Β· **5/5** Β· *Featured. Legacy.* "American actor (1909–1994)." | +| 3 | **Zbyszek Godlewski** (killed at a 1970 protest) | human β†’ Figure, History. 77/48/78 β†’ fame 68 β†’ cost 5. Legacy (1970 deaths, βˆ’1), Translated (pct_r 78, 0). 9 split 77:48 β†’ 6/3. | **Zbyszek Godlewski** Β· 5 Β· Figure β€” History Β· **6/3** Β· *Legacy. Translated.* "Polish protester (1952–1970)." | +| 4 | **Pallas's cat** | taxon β†’ Figure, Earth. 99/97/99 β†’ fame 98 β†’ cost 6. Featured (βˆ’1), Multilingual (βˆ’1); Well-sourced dropped. 10 β†’ 5/5. | **Pallas's cat** Β· 6 Β· Figure β€” Earth Β· **5/5** Β· *Featured. Multilingual.* "Species of small wild cat." | +| 5 | **Dichromorpha viridis** | taxon β†’ Figure, Earth. 58/3/53 β†’ fame 38 β†’ cost 2, budget 4. Stub (1,347 bytes, untaxed). Split clamps to 3/1. | **Dichromorpha viridis** Β· 2 Β· Figure β€” Earth Β· **3/1** Β· *Stub.* "Species of grasshopper." | +| 6 | **Monoid** (maths) | no P31; category "Algebraic structures" β†’ Doctrine, Science. fame 96 β†’ cost 6, k = 3. Maths rider. | **Monoid** Β· 6 Β· Doctrine β€” Science Β· Attach to target Figure you control. It gets +3/+3 and has Well-sourced. "Algebraic structure with an associative operation and an identity element." | +| 7 | **Heart rot** (disease) | P31 plant disease β†’ Doctrine, Pathology (T12). Science. fame 68 β†’ cost 5, k = 3. | **Heart rot** Β· 5 Β· Doctrine β€” Science Β· Attach to target Figure. It gets βˆ’3/βˆ’3. "Fungal disease of trees." | +| 8 | **April 2021 nor'easter** (disaster) | P31 nor'easter β†’ Event, disaster (T4). Earth. fame 50 β†’ cost 3, k = 2. | **April 2021 nor'easter** Β· 3 Β· Event β€” Earth Β· Deal 1 damage to each Figure and each Location. "Slow-moving nor'easter in April 2021." | +| 9 | **2025 Tehreek-e-Labbaik Pakistan protests** (conflict) | P31 protest β†’ Event, conflict (T3). Society (protest/riot hits outnumber "war"). fame 64 β†’ cost 5, k = 3. | **2025 Tehreek-e-Labbaik Pakistan protests** Β· 5 Β· Event β€” Society Β· Deal 4 damage to target Figure or Location. "Gaza war protests in Pakistan." | +| 10 | **1954 Gold Coast general election** | P31 legislative election β†’ Event, election (T5). Society. fame 45 β†’ cost 3, k = 2. | **1954 Gold Coast general election** Β· 3 Β· Event β€” Society Β· Create two 1/1 Society Figure tokens named Elected Member. *(no flavour: empty description)* | +| 11 | **Pathrail Mosque** | P31 mosque β†’ Location, Society ("mosque" hits in P31, the description and two categories outnumber 15th-century + Sultanate). fame 49 β†’ cost 3 β†’ Location cost 2. pct_d 54 β†’ Garrison 0/3. | **Pathrail Mosque** Β· 2 Β· Location β€” Society Β· Territory. Garrison 0/3. "Mosque in Faridpur, Bangladesh." | +| 12 | **Tatsunoko Production** | P31 animation studio β†’ Institution, organisation (T8). Arts. fame 93 β†’ cost 6. | **Tatsunoko Production** Β· 6 Β· Institution β€” Arts Β· At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member. "Japanese animation studio." | + +Interactions these cards show: +- *Heart rot* on *Marc Fesneau* is illegal (Protected stops opponents' Doctrines). On *Tom Ewell* it makes a 2/2 Featured Legacy. +- *Monoid* on *Dichromorpha viridis* makes a 6/4 Well-sourced Stub that keeps growing to 8/6. +- *April 2021 nor'easter* destroys *Dichromorpha viridis* and both Elected Members, and leaves *Pathrail Mosque* at 0/3 with 1 damage. +- *Pathrail Mosque* and *2025 Tehreek-e-Labbaik Pakistan protests* are not Compatriots (Bangladesh vs Pakistan); *Pathrail Mosque* and *Zbyszek Godlewski* are not Contemporary (15th vs 20th century). + +Sample log: +> Turn 5. alice deployed *Zbyszek Godlewski* (Polish protester, 1952–1970).[1] +> Turn 6. bob cited the *April 2021 nor'easter* (Slow-moving nor'easter in April 2021).[2] The *April 2021 nor'easter* dealt 1 damage to *Zbyszek Godlewski*. +> Turn 7. *Zbyszek Godlewski* (6/3) attacked. *Pallas's cat* (5/5) blocked *Zbyszek Godlewski*.[3] *Zbyszek Godlewski* was destroyed. alice drew a card. + +--- + +## 10. Hand-offs +- **duel-core:** Β§2 rules and ruleset keys; `LogEvent` kinds needed by Β§8.2 (deploy, cast, adopt, attack, block, playerDamage, destroyed, effectDamage, tokenCreated, draw, connected, turnStart, gameOver with reason `life|library|concede|timeout|turnCap`). Each event carries card ids, P/T after the event, and Notability where relevant. +- **duel-cards:** Β§3 derivation, Β§4 thresholds and priority, Β§5 templates T1–T12, Β§6 tiers; the Β§9 table as golden tests. +- **sim-balance:** Β§2.6 targets; tune `keywordThresholds`, `connectedTiers`, T4's kβˆ’1, the Stub cap and the T8 token rate; report the first-player win rate and the cost-6 dominance check. +- **ui-pvp:** renders `RecapDoc` from Β§8.3. + +## 11. Open questions for the sim (not blockers) +1. Disaster T4 at kβˆ’1 may be weak against 40-card boards; try k. +2. Stub at +2 counters on cheap bodies may be too strong (33% of Figures); try max 1. +3. **Locations (balance v1 finding):** Location-heavy decks win ~20% and Locations are the weakest cards. `territoryCap` 3, `locationsPerTurn` 2 and `garrisonStep` 15 move them Β±3 points at most. Tested and **rejected for v1**: a T2 rider "When this enters, draw a card". It lifts the Location card (47 β†’ 52%) but not Location-heavy decks (18 β†’ 17%), pushes the first player back to 58.4%, and brings back library-out losses. Open for v1.1: a lever that helps Location-heavy decks without extra card flow, e.g. Territory that scales (+1 Citation per two Locations) or Garrison Locations that can block Featured. diff --git a/docs/game/HOSTING.md b/docs/game/HOSTING.md index d736c33..49aa7a3 100644 --- a/docs/game/HOSTING.md +++ b/docs/game/HOSTING.md @@ -18,12 +18,13 @@ A mode is a JSON document, at most 8 KiB: ```json { - "schema": "wikideck.mode/1", + "schema": "wikideck.mode/2", "id": "trending", "version": 1, "name": "Trending", "description": "Live Wikipedia pageview trends power cards up or down.", "tags": ["live-data"], + "engine": "editwar", "rules": { "trendUp": 25, "trendDown": -25 }, "cards": { "preset": "trending", "percentPerPoint": 25, "maxBonus": 3, "penalise": true }, "decks": { "kind": "starter" }, @@ -33,12 +34,14 @@ A mode is a JSON document, at most 8 KiB: | Field | Meaning | |---|---| +| `schema` | `wikideck.mode/2`. Night 1 documents (`wikideck.mode/1`) are rejected with a message saying what to change. | +| `engine` | Required: `editwar` (the Night 1 simultaneous-reveal game, `shared/game`) or `duel` (the Night 2 Magic-style duel, `shared/duel`). Duel modes only allow `constructed` and `draft` with `source: "collections"`: every card is one the players own. | | `id`, `version` | Lowercase slug and a version integer. Bump `version` whenever the rules change, so old match records and leaderboards stay attributable (`#@`). | | `name`, `description`, `tags` | Plain text only: no control characters or `<` `>`. | | `rules` | **Overrides** on top of the engine's `DEFAULT_RULESET` (see `docs/game/ENGINE_API.md`). Objects merge one level deep; arrays and numbers replace. The merged result then goes through the engine's strict `parseRuleset`, so the engine alone decides what's legal (bounded turns, Topics, deck sizes, known keywords and portals only; see DESIGN.md Β§9 for the keys). | | `cards` | A card-mapping **preset** from a fixed list. `standard` leaves cards as dealt. `live` freezes each card's live trend arrow (DESIGN Β§1.6, using the ruleset's `trendUp`/`trendDown`) at match start. `trending` does the same and also adds a bounded power bonus from the live pageview trend. The mode only picks a preset and tunes its bounded numbers. | -| `decks` | `starter` (everyone gets a seeded starter deck), `draft` (snake draft from a host-seeded pool of preview cards) or `constructed` (bring your own; see "Not yet" below). | -| `limits` | Concurrency and lobby expiry for this mode on this host. `turnSeconds` only applies to engines without their own turn timer; with tonight's engine, the ruleset's `turnSeconds` (plus 5 s network grace) is the timer. | +| `decks` | `constructed` (each player submits exactly `deckSize` NFT token ids they own; the host verifies ownership and confirmations on the chain, `minConfirmations` default 1, and builds every card from its block), `starter` (Edit War only: a seeded starter deck) or `draft` (snake draft; `source: "preview"` uses preview cards, Edit War only; `source: "collections"` pools both players' owned cards for that match only, and both must own at least `deckSize`). | +| `limits` | Concurrency and lobby expiry for this mode on this host. `rated: true` moves Elo (start 1200, K 24) when both seats are eom.dev accounts; `accountsOnly: true` refuses guest seats (owned-card modes always do). `turnSeconds` only applies to engines without their own turn timer; with tonight's engine, the ruleset's `turnSeconds` (plus 5 s network grace) is the timer. | The schema is strict: unknown fields are rejected, as are prototype keys (`__proto__`, `constructor`, `prototype`) anywhere in the document, nesting deeper than two @@ -46,6 +49,17 @@ levels inside `rules`, more than 48 rule keys, and oversized strings and arrays. **never** evaluates, imports or runs anything another peer sends. Nothing in a mode can name a file, a URL, a script or a function. +### Seats, invites, quick match and polling (Night 2) + +- **Seats:** `POST /modes/:id/lobbies`, `POST /lobbies/:id/join` and `POST /modes/:id/quick` take `{idToken, deck?, private?}` for an eom.dev account (the Dex ID token may also be sent as `Authorization: Bearer `), or `{name, secret}` for a guest in Edit War modes. The reply is `{lobbyId, seat, token, invite, playerId}`; `token` is the seat bearer for every later call. Account player ids are `sha256("acct:" + iss + "\n" + sub)`. +- **Invites:** every lobby gets a 12-character `invite` code. `private: true` hides it from `/lobbies` and quick match. `GET /invites/:code` describes it and `POST /invites/:code/join` joins it (SPA link: `/play/invite/`). +- **Quick match:** `POST /modes/:id/quick` joins the oldest open public lobby someone else opened (`matched: true`), or opens one (`matched: false`) to poll. +- **Polling:** every lobby view has a `version`. `GET /lobbies/:id?v=` answers **204** while nothing changed. Poll; never hold requests open (the node caps concurrent `/api` requests). +- **Ladder:** `GET /modes/:id/ladder` (same as `/leaderboard`): entries carry `rating` (Elo, or null if unrated) plus W/L/D. +- **Duel cards:** `server/game/duel-binding.ts` `toDuelCard` is the one path from an owned NFT to a duel card, for matches and for `GET /api/game/collection` card faces. It uses the frozen card identity (`/card-identity.sqlite`, testnet-ops' pre-bake) when present. Otherwise it types the card from what its block carries (the extract's first sentence, then the mint-time category), with no fetch. So a card's *collection* type can change **once**, when its identity is first frozen. Matches never change: the record stores the derived cards. Run the identity pre-bake before opening a node to PvP. +- **Clock:** duel turns get `turnSeconds` (+5 s grace) plus a per-seat `bankSeconds` bank; seat views carry `clock: {turnStartedAt, turnMs, bankMs}`. +- **Records:** `GET /matches/:id` has the seed, rules, both decks (as the engine cards), every action, `engine`, `rated`, and for constructed modes `tokens` (the NFT ids each seat played), so the recap can replay the match. + ## 2. Running your own modes Configure modes with environment variables on your node: @@ -255,10 +269,9 @@ be pinned in consensus. ## Not yet -- `constructed` decks of **owned NFTs**: the policy exists, but tonight the host deals - starter decks for it. Playing with your own cards needs a wallet-signed ownership proof - for the lobby (and then the engine's `cardFromStats`). That's a follow-up once accounts and - wallet linking (#7) settle. +- `constructed` decks of **owned NFTs** are verified on the hosting node only, against its + own account store (Night 2). Playing them on a *peer* needs a wallet-signed deck claim, + because accounts are per node; that's a follow-up. - `trending` never calls Wikipedia when a match starts. The node warms a cache-only trend store in the background, one page every 20 s (configurable, never faster than 15 s), through its existing enrichment cache (6 h TTL), starting with the preview-card pages. A card whose page isn't warm yet gets no bonus. This diff --git a/docs/game/OWNERSHIP_API.md b/docs/game/OWNERSHIP_API.md new file mode 100644 index 0000000..0a03096 --- /dev/null +++ b/docs/game/OWNERSHIP_API.md @@ -0,0 +1,73 @@ +# Ownership and collection API (Night 2, #57) + +Server-side checks that a player owns the cards they play. Off-chain only: nothing here moves, burns or locks a card, and nothing changes consensus. + +## The rules (ruleset data) + +| Key | Default | Meaning | +|---|---|---| +| `deckSize` | 40 | A constructed deck has exactly this many cards. A testnet mode file may lower it. | +| `maxCopiesPerPage` | 4 | The MTG-style copy limit. Cards minted from the same Wikipedia `pageId` are separate cards, but at most this many go in one deck. | +| `minConfirmations` | 1 | The confirmations each card's mint block needs. Rated play uses `RATED_MIN_CONFIRMATIONS` = 3. | + +## `server/game/ownership.ts` (used by the PvP host) + +```ts +verifyAccount(deps, idToken: unknown): Promise +resolveDeck(deps, account, tokenIds: unknown, opts?: Partial): Promise +collection(deps, account, opts?: { minConfirmations?: number }): Promise +``` + +- **`deps`** is `{ ledger, accounts, verifyIdToken }`. In production, `server/testnet/http.ts` builds it from the node's `Ledger`, the shared `AccountStore`, and `accountVerifier()` from `server/account/router.ts`. It passes the result to `gameRouter({ ownership })`. +- **`resolveDeck`** accepts token ids only, never card JSON. For each card it checks: + - the card is on the canonical chain (`ledger.nft()`); + - its current owner (after transfers) is one of the account's linked wallets; + - it has enough confirmations; + - the deck size and copy limit. + + Each card is rebuilt from its own block (`article` and `statsSnapshot`). The cards come back in the order given. +- **Errors** are thrown as `DeckError { code, status, tokenIds, pageId? }`. `tokenIds` lists every offending card of that class. + + | `code` | `status` | + |---|---| + | `auth` | 401 | + | `size` | 400 | + | `duplicate-token` | 400 | + | `unknown-token` (not on chain, or malformed) | 400 | + | `not-owned` (includes "no linked wallet") | 403 | + | `unconfirmed` | 400 | + | `copy-limit` | 400 | + + `OwnershipUnavailable` (503) means Dex is unreachable or the chain tip kept moving during a read. +- **`collection`** pages `ledger.deck()` (24 per page) across every linked wallet at one canonical tip, restarting if the tip moves. There is no 128-block snapshot cap. + +## `GET /api/game/collection` + +`Authorization: Bearer ` (the same token as `/api/account/me`). Optional: `?minConfirmations=N`. + +```ts +{ + tip, wallets: string[], + deckSize: 40, copyLimit: 4, maxCopiesPerPage: 4, minConfirmations: 1, + owned: number, // confirmed cards across all linked wallets + playable: number, // Ξ£ min(copies, copyLimit) per pageId + needed: number, // max(0, deckSize - playable) + eligible: boolean, // playable >= deckSize + cards: ChainCard[] // tokenId, owner, confirmations, pageId, title, revisionId, url, extract, imageUrl?, + // height, blockHash, createdAt, powHash, article, statsSnapshot +} +``` + +| Case | Response | +|---|---| +| No linked wallets | 200 with `cards: []` and `needed: 40` | +| Missing or invalid token | 401 | +| Dex unreachable | 503 | +| Bad query | 400 | + +The UI shows `playable / deckSize`, for example "23 / 40 cards", and how to mine. + +## Not covered (known gaps) + +- **Peer hosts.** Account stores are per node, and a Dex token sent to a peer could be replayed elsewhere (engineer review Β§2, G6). This API is for the self-hosted node only. The stretch fix is a wallet-signed deck claim. +- **Plausibility of minted stats** (G5): `pageId` β†’ `title` and `revisionId` β†’ `size` are not cross-checked yet. diff --git a/docs/game/duel-card-sample.json b/docs/game/duel-card-sample.json new file mode 100644 index 0000000..a82bd43 --- /dev/null +++ b/docs/game/duel-card-sample.json @@ -0,0 +1,10821 @@ +{ + "source": "docs/game/card-sample.json", + "deriveVersion": "duel-derive-1", + "count": 236, + "cards": [ + { + "cardId": "0000000000000000000000000000000000000000000000000000000000851c64", + "pageId": 8723556, + "revisionId": 1358732737, + "title": "Salahuddin of Aceh", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 4, + "power": 4, + "toughness": 3, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "Sultan of Aceh (1530–1537/9)", + "connect": { + "countries": [ + "Indonesia" + ], + "centuries": [ + 16 + ], + "links": [], + "p31": [], + "qid": "Q4264920", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 62, + "pctDepth": 48, + "pctReach": 63, + "fame": 58, + "magnitude": 2 + }, + "description": "Sultan of Aceh (1530–1537/9)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000a4cc4d", + "pageId": 10800205, + "revisionId": 1376918522, + "title": "St. Georgen am LΓ€ngsee", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Municipality in Carinthia, Austria", + "connect": { + "countries": [ + "Austria" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1802801", + "Q667509" + ], + "qid": "Q664135", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 35, + "pctDepth": 43, + "pctReach": 93, + "fame": 57, + "magnitude": 2 + }, + "description": "Municipality in Carinthia, Austria" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001849df5", + "pageId": 25468405, + "revisionId": 1378546622, + "title": "MaracΓ‘s", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Municipality of Bahia, Brazil", + "connect": { + "countries": [ + "Brazil" + ], + "centuries": [], + "links": [], + "p31": [ + "Q3184121" + ], + "qid": "Q1795100", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 42, + "pctDepth": 43, + "pctReach": 91, + "fame": 59, + "magnitude": 2 + }, + "description": "Municipality of Bahia, Brazil" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000018a8b89", + "pageId": 25856905, + "revisionId": 1367363150, + "title": "Dichromorpha viridis", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 3, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of grasshopper", + "connect": { + "countries": [], + "centuries": [ + 19 + ], + "links": [], + "p31": [], + "qid": "Q5272562", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 3, + "pctReach": 53, + "fame": 38, + "magnitude": 1 + }, + "description": "Species of grasshopper" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002309e43", + "pageId": 36740675, + "revisionId": 1372732350, + "title": "The Best of Men", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "2012 British television film", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q506240" + ], + "qid": "Q7717125", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 80, + "pctDepth": 48, + "pctReach": 53, + "fame": 60, + "magnitude": 2 + }, + "description": "2012 British television film" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000279b34c", + "pageId": 41530188, + "revisionId": 1383948367, + "title": "HervΓ© Fischer", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 2, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "", + "connect": { + "countries": [ + "France" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q3134490", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 68, + "pctReach": 63, + "fame": 55, + "magnitude": 2 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000027beec0", + "pageId": 41676480, + "revisionId": 1187069209, + "title": "Mary Sophie Young", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "American botanist (c.1872–1919)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q16043849", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 11, + "pctDepth": 38, + "pctReach": 47, + "fame": 32, + "magnitude": 1 + }, + "description": "American botanist (c.1872–1919)" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000039663ae", + "pageId": 60187566, + "revisionId": 1353977816, + "title": "Oncopagurus", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 5, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Genus of crustaceans", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q4471563", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 11, + "pctReach": 63, + "fame": 39, + "magnitude": 2 + }, + "description": "Genus of crustaceans" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000404da56", + "pageId": 67426902, + "revisionId": 1355258366, + "title": "April 2021 nor'easter", + "type": "Event", + "subtype": "disaster", + "portal": "Earth", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "damageEach", + "target": "each", + "amount": 1, + "template": "T4" + } + ], + "rulesText": "Deal 1 damage to each Figure and each Location.", + "flavor": "Slow-moving nor'easter in April 2021", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q2001587" + ], + "qid": "Q106542029", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 52, + "pctDepth": 89, + "pctReach": 8, + "fame": 50, + "magnitude": 2 + }, + "description": "Slow-moving nor'easter in April 2021" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000007f1bfc", + "pageId": 8330236, + "revisionId": 1383654640, + "title": "Hiroshima Electric Railway", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Japanese transportation company", + "connect": { + "countries": [ + "Japan" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q85907346" + ], + "qid": "Q16595959", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 86, + "pctDepth": 64, + "pctReach": 82, + "fame": 77, + "magnitude": 3 + }, + "description": "Japanese transportation company" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000f14093", + "pageId": 15810707, + "revisionId": 1381828954, + "title": "Charmont-en-Beauce", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Commune in Centre-Val de Loire, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q484170" + ], + "qid": "Q667131", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 17, + "pctDepth": 7, + "pctReach": 94, + "fame": 39, + "magnitude": 2 + }, + "description": "Commune in Centre-Val de Loire, France" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000f2623f", + "pageId": 15884863, + "revisionId": 1358001871, + "title": "Freshwater River", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "River on Stewart Island / Rakiura, New Zealand", + "connect": { + "countries": [ + "New Zealand" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4022" + ], + "qid": "Q5503122", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 24, + "pctDepth": 33, + "pctReach": 58, + "fame": 38, + "magnitude": 1 + }, + "description": "River on Stewart Island / Rakiura, New Zealand" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000011e7dea", + "pageId": 18775530, + "revisionId": 1378518207, + "title": "ZΕ‚akΓ³w KoΕ›cielny", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Village in ŁódΕΊ Voivodeship, Poland", + "connect": { + "countries": [ + "Poland" + ], + "centuries": [], + "links": [], + "p31": [ + "Q3558970" + ], + "qid": "Q321622", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 4, + "pctDepth": 2, + "pctReach": 67, + "fame": 24, + "magnitude": 1 + }, + "description": "Village in ŁódΕΊ Voivodeship, Poland" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000175fc6f", + "pageId": 24509551, + "revisionId": 1367096869, + "title": "Village (Pennsylvania)", + "type": "Location", + "subtype": null, + "portal": "Society", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q16936588", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 38, + "pctDepth": 33, + "pctReach": 8, + "fame": 26, + "magnitude": 1 + } + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000180a290", + "pageId": 25207440, + "revisionId": 1376759357, + "title": "Sainte-FΓ©licitΓ©, ChaudiΓ¨re-Appalaches", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Municipality in Quebec, Canada", + "connect": { + "countries": [ + "Canada" + ], + "centuries": [], + "links": [], + "p31": [ + "Q27676428" + ], + "qid": "Q3464275", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 11, + "pctDepth": 38, + "pctReach": 67, + "fame": 39, + "magnitude": 2 + }, + "description": "Municipality in Quebec, Canada" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001c845f2", + "pageId": 29902322, + "revisionId": 1325745411, + "title": "Llanveynoe", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Village in Herefordshire, England", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1115575", + "Q532" + ], + "qid": "Q6661845", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 31, + "pctDepth": 33, + "pctReach": 67, + "fame": 44, + "magnitude": 2 + }, + "description": "Village in Herefordshire, England" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003f6d6d1", + "pageId": 66508497, + "revisionId": 1323515500, + "title": "Amanita mairei", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 3, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of fungus", + "connect": { + "countries": [], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q15651951", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 0, + "pctReach": 71, + "fame": 38, + "magnitude": 1 + }, + "description": "Species of fungus" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004cd4092", + "pageId": 80560274, + "revisionId": 1351705367, + "title": "1912 Argentine Primera DivisiΓ³n final", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 1, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +1/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "Football match", + "connect": { + "countries": [ + "Argentina" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q12166442", + "Q1366722" + ], + "qid": "Q135493693", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 14, + "pctDepth": 73, + "pctReach": 8, + "fame": 32, + "magnitude": 1 + }, + "description": "Football match" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000071fcb", + "pageId": 466891, + "revisionId": 1386046344, + "title": "City of Wyndham", + "type": "Location", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Local government area in Victoria, Australia", + "connect": { + "countries": [ + "Australia" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q1426035" + ], + "qid": "Q1502429", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 86, + "pctDepth": 77, + "pctReach": 74, + "fame": 79, + "magnitude": 3 + }, + "description": "Local government area in Victoria, Australia" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000025711c", + "pageId": 2453788, + "revisionId": 1374732887, + "title": "Heart rot", + "type": "Doctrine", + "subtype": "pathology", + "portal": "Science", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "figure", + "template": "T12" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": -3, + "toughness": -3, + "template": "T12" + } + ], + "rulesText": "Attach to target Figure. It gets βˆ’3/βˆ’3.", + "flavor": "Fungal disease of trees", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q2662845" + ], + "qid": "Q5692479", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 83, + "pctDepth": 68, + "pctReach": 53, + "fame": 68, + "magnitude": 3 + }, + "description": "Fungal disease of trees" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000002ad3e8", + "pageId": 2806760, + "revisionId": 1385958400, + "title": "Jess Harnell", + "type": "Figure", + "subtype": null, + "portal": "Arts", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected", + "Featured" + ], + "effects": [], + "rulesText": "Protected, Featured.", + "flavor": "American voice actor and singer (born 1963)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q258503", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 99, + "pctDepth": 96, + "pctReach": 89, + "fame": 95, + "magnitude": 3 + }, + "description": "American voice actor and singer (born 1963)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000089b9d0", + "pageId": 9026000, + "revisionId": 1351068420, + "title": "Names of Poland", + "type": "Doctrine", + "subtype": "language", + "portal": "Neutral", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + }, + { + "trigger": "onCombatDamageToPlayer", + "op": "draw", + "amount": 1, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.\nWhenever it deals combat damage to a player, draw a card.", + "flavor": "", + "connect": { + "countries": [ + "Poland" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q6961536", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 89, + "pctDepth": 83, + "pctReach": 53, + "fame": 75, + "magnitude": 3 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000f09c8c", + "pageId": 15768716, + "revisionId": 1382030873, + "title": "Ungersheim", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Commune in Grand Est, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q484170" + ], + "qid": "Q122940", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 42, + "pctDepth": 28, + "pctReach": 96, + "fame": 55, + "magnitude": 2 + }, + "description": "Commune in Grand Est, France" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000246d152", + "pageId": 38195538, + "revisionId": 1354427246, + "title": "Joe Gideon & the Shark", + "type": "Institution", + "subtype": "organisation", + "portal": "Arts", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "English blues/indie rock band", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [], + "links": [], + "p31": [ + "Q215380" + ], + "qid": "Q3012108", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 52, + "pctDepth": 17, + "pctReach": 23, + "fame": 31, + "magnitude": 1 + }, + "description": "English blues/indie rock band" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000025ed7ee", + "pageId": 39770094, + "revisionId": 1376919282, + "title": "2013–14 California Golden Bears men's basketball team", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 2, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +2/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "American college basketball season", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q26894053" + ], + "qid": "Q16245089", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 24, + "pctDepth": 92, + "pctReach": 8, + "fame": 41, + "magnitude": 2 + }, + "description": "American college basketball season" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002f85b42", + "pageId": 49830722, + "revisionId": 1116073630, + "title": "Dicroidium odontopteroides", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub", + "Local" + ], + "effects": [], + "rulesText": "Stub, Local.", + "flavor": "Species of ancient plant", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q25095289", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 11, + "pctReach": 8, + "fame": 20, + "magnitude": 1 + }, + "description": "Species of ancient plant" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000031e1299", + "pageId": 52302489, + "revisionId": 1380325251, + "title": "Pathrail Mosque", + "type": "Location", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Mosque in Faridpur, Bangladesh", + "connect": { + "countries": [ + "Bangladesh" + ], + "centuries": [ + 15 + ], + "links": [], + "p31": [ + "Q32815" + ], + "qid": "Q28173356", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 47, + "pctDepth": 54, + "pctReach": 47, + "fame": 49, + "magnitude": 2 + }, + "description": "Mosque in Faridpur, Bangladesh" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000001e346c", + "pageId": 1979500, + "revisionId": 1382599906, + "title": "Zbyszek Godlewski", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 5, + "power": 6, + "toughness": 3, + "territory": 0, + "keywords": [ + "Legacy", + "Translated" + ], + "effects": [], + "rulesText": "Legacy, Translated.", + "flavor": "Polish protester (1952–1970)", + "connect": { + "countries": [ + "Poland" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q3497070", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 77, + "pctDepth": 48, + "pctReach": 78, + "fame": 68, + "magnitude": 3 + }, + "description": "Polish protester (1952–1970)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000438c15", + "pageId": 4426773, + "revisionId": 1384528612, + "title": "Agda (programming language)", + "type": "Doctrine", + "subtype": "language", + "portal": "Science", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + }, + { + "trigger": "onCombatDamageToPlayer", + "op": "draw", + "amount": 1, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.\nWhenever it deals combat damage to a player, draw a card.", + "flavor": "Functional programming language", + "connect": { + "countries": [], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q11387554", + "Q28920201", + "Q341", + "Q3839507", + "Q56223375", + "Q9143" + ], + "qid": "Q20479", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 91, + "pctDepth": 77, + "pctReach": 78, + "fame": 82, + "magnitude": 3 + }, + "description": "Functional programming language" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000475385", + "pageId": 4674437, + "revisionId": 1384106265, + "title": "Topusko", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Commune in Sisak-Moslavina County, Croatia", + "connect": { + "countries": [ + "Croatia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q57058" + ], + "qid": "Q2457438", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 74, + "pctDepth": 77, + "pctReach": 90, + "fame": 80, + "magnitude": 3 + }, + "description": "Commune in Sisak-Moslavina County, Croatia" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000004dc3c7", + "pageId": 5096391, + "revisionId": 1376332037, + "title": "Isabella of Aragon, Queen of Portugal", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 6, + "power": 6, + "toughness": 4, + "territory": 0, + "keywords": [ + "Featured", + "Legacy" + ], + "effects": [], + "rulesText": "Featured, Legacy.", + "flavor": "Queen of Portugal from 1497 to 1498", + "connect": { + "countries": [ + "France", + "Italy", + "Portugal", + "Spain", + "United Kingdom" + ], + "centuries": [ + 15 + ], + "links": [], + "p31": [], + "qid": "Q466305", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 97, + "pctDepth": 77, + "pctReach": 97, + "fame": 90, + "magnitude": 3 + }, + "description": "Queen of Portugal from 1497 to 1498" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000f2d966", + "pageId": 15915366, + "revisionId": 1381946137, + "title": "Montjavoult", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Commune in Hauts-de-France, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q484170" + ], + "qid": "Q1336846", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 3, + "pctDepth": 4, + "pctReach": 95, + "fame": 34, + "magnitude": 1 + }, + "description": "Commune in Hauts-de-France, France" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000f39622", + "pageId": 15963682, + "revisionId": 1384826851, + "title": "Viktor Genev", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 4, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected", + "Translated" + ], + "effects": [], + "rulesText": "Protected, Translated.", + "flavor": "Bulgarian footballer", + "connect": { + "countries": [ + "Bulgaria", + "Israel", + "Kazakhstan", + "Romania", + "Russia", + "Ukraine", + "United Kingdom" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q2604995", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 52, + "pctDepth": 77, + "pctReach": 81, + "fame": 70, + "magnitude": 3 + }, + "description": "Bulgarian footballer" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001aba163", + "pageId": 28025187, + "revisionId": 1377386321, + "title": "PΓΌhajΓ΅e", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Village in Estonia", + "connect": { + "countries": [ + "Estonia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q51049922" + ], + "qid": "Q179358", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 11, + "pctDepth": 11, + "pctReach": 78, + "fame": 33, + "magnitude": 1 + }, + "description": "Village in Estonia" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002ed73e4", + "pageId": 49116132, + "revisionId": 1376271314, + "title": "Kalihati", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Town in Dhaka Division, Bangladesh", + "connect": { + "countries": [ + "Bangladesh" + ], + "centuries": [], + "links": [], + "p31": [ + "Q23759397", + "Q3957" + ], + "qid": "Q22348003", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 27, + "pctDepth": 38, + "pctReach": 47, + "fame": 37, + "magnitude": 1 + }, + "description": "Town in Dhaka Division, Bangladesh" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002f27561", + "pageId": 49444193, + "revisionId": 1371976132, + "title": "Miloje VasiΔ‡", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 5, + "power": 4, + "toughness": 5, + "territory": 0, + "keywords": [ + "Legacy", + "Translated" + ], + "effects": [], + "rulesText": "Legacy, Translated.", + "flavor": "Serbian archaeologist (1869–1956)", + "connect": { + "countries": [ + "Serbia" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q3314419", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 89, + "pctReach": 78, + "fame": 75, + "magnitude": 3 + }, + "description": "Serbian archaeologist (1869–1956)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000001adbf", + "pageId": 110015, + "revisionId": 1377786275, + "title": "Haralson, Georgia", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Town in Georgia, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q15127012", + "Q76514543" + ], + "qid": "Q2520618", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 62, + "pctDepth": 64, + "pctReach": 91, + "fame": 72, + "magnitude": 3 + }, + "description": "Town in Georgia, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000ab844d", + "pageId": 11240525, + "revisionId": 1382620781, + "title": "Joseph Ujlaki", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 5, + "toughness": 2, + "territory": 0, + "keywords": [ + "Legacy", + "Translated" + ], + "effects": [], + "rulesText": "Legacy, Translated.", + "flavor": "French-Hungarian footballer (1929-2006)", + "connect": { + "countries": [ + "France", + "Hungary" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q905343", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 64, + "pctDepth": 28, + "pctReach": 82, + "fame": 58, + "magnitude": 2 + }, + "description": "French-Hungarian footballer (1929-2006)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000162de74", + "pageId": 23256692, + "revisionId": 1176682009, + "title": "Coelogyne trinervis", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 3, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of orchid", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q188238" + ], + "qid": "Q1601035", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 17, + "pctDepth": 4, + "pctReach": 67, + "fame": 29, + "magnitude": 1 + }, + "description": "Species of orchid" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001d74bfb", + "pageId": 30886907, + "revisionId": 1367824379, + "title": "Pine River (Manistee River tributary)", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "River in Michigan, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4022" + ], + "qid": "Q7195337", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 54, + "pctDepth": 38, + "pctReach": 23, + "fame": 38, + "magnitude": 1 + }, + "description": "River in Michigan, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003b4f3b0", + "pageId": 62190512, + "revisionId": 1377313379, + "title": "Nguyα»…n VΔƒn Huy", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 3, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Stub" + ], + "effects": [], + "rulesText": "Protected, Stub.", + "flavor": "Vietnamese chess grandmaster (born 1985)", + "connect": { + "countries": [ + "Vietnam" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q20026028", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 28, + "pctReach": 47, + "fame": 41, + "magnitude": 2 + }, + "description": "Vietnamese chess grandmaster (born 1985)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003d6c241", + "pageId": 64406081, + "revisionId": 1280859035, + "title": "San Wai (San Tin)", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q532" + ], + "qid": "Q96739151", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 48, + "pctReach": 23, + "fame": 31, + "magnitude": 1 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003e433c1", + "pageId": 65287105, + "revisionId": 1376673468, + "title": "Kishore Tirumala", + "type": "Figure", + "subtype": null, + "portal": "Arts", + "cost": 4, + "power": 4, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Featured" + ], + "effects": [], + "rulesText": "Protected, Featured.", + "flavor": "Indian film director", + "connect": { + "countries": [ + "India" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q93762585", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 91, + "pctDepth": 54, + "pctReach": 36, + "fame": 60, + "magnitude": 2 + }, + "description": "Indian film director" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004d8a703", + "pageId": 81307395, + "revisionId": 1378554406, + "title": "2025 Tehreek-e-Labbaik Pakistan protests", + "type": "Event", + "subtype": "conflict", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "damage", + "target": "figureOrLocation", + "amount": 4, + "template": "T3" + } + ], + "rulesText": "Deal 4 damage to target Figure or Location.", + "flavor": "Gaza war protests in Pakistan", + "connect": { + "countries": [ + "Israel", + "Pakistan" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q273120" + ], + "qid": "Q136649814", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 82, + "pctDepth": 86, + "pctReach": 23, + "fame": 64, + "magnitude": 3 + }, + "description": "Gaza war protests in Pakistan" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000000dc52e", + "pageId": 902446, + "revisionId": 1378970556, + "title": "Guidimaka region", + "type": "Location", + "subtype": null, + "portal": "Neutral", + "cost": 3, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Region of Mauritania", + "connect": { + "countries": [ + "Mauritania" + ], + "centuries": [], + "links": [], + "p31": [ + "Q846327" + ], + "qid": "Q768119", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 58, + "pctDepth": 77, + "pctReach": 94, + "fame": 76, + "magnitude": 3 + }, + "description": "Region of Mauritania" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000014fa5c", + "pageId": 1374812, + "revisionId": 1381663979, + "title": "Tom Ewell", + "type": "Figure", + "subtype": null, + "portal": "Arts", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Featured", + "Legacy" + ], + "effects": [], + "rulesText": "Featured, Legacy.", + "flavor": "American actor (1909–1994)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q427388", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 94, + "pctDepth": 83, + "pctReach": 93, + "fame": 90, + "magnitude": 3 + }, + "description": "American actor (1909–1994)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000ea6920", + "pageId": 15362336, + "revisionId": 1351181171, + "title": "1954 Gold Coast general election", + "type": "Event", + "subtype": "election", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "createToken", + "amount": 2, + "token": { + "name": "Elected Member", + "power": 1, + "toughness": 1, + "portal": "Society" + }, + "template": "T5" + } + ], + "rulesText": "Create two 1/1 Society Figure tokens named Elected Member.", + "flavor": "", + "connect": { + "countries": [ + "Ghana", + "United Kingdom" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q2618461" + ], + "qid": "Q2539674", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 66, + "pctDepth": 33, + "pctReach": 36, + "fame": 45, + "magnitude": 2 + } + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000162a8e7", + "pageId": 23242983, + "revisionId": 1351414373, + "title": "Larry Weber", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "American entrepreneur", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q6491266", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 66, + "pctDepth": 73, + "pctReach": 36, + "fame": 58, + "magnitude": 2 + }, + "description": "American entrepreneur" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002f59319", + "pageId": 49648409, + "revisionId": 1344963259, + "title": "Ulla! min Ulla! SΓ€j fΓ₯r jag dig bjuda", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "Song by the 18th century Swedish bard Carl Michael Bellman", + "connect": { + "countries": [ + "Sweden" + ], + "centuries": [ + 18 + ], + "links": [], + "p31": [ + "Q105543609" + ], + "qid": "Q19528685", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 27, + "pctDepth": 83, + "pctReach": 23, + "fame": 44, + "magnitude": 2 + }, + "description": "Song by the 18th century Swedish bard Carl Michael Bellman" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000506ce99", + "pageId": 84332185, + "revisionId": 1378056768, + "title": "Oscar GonzΓ‘lez Oro", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 3, + "power": 4, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "Argentine journalist and radio host (1951–2026)", + "connect": { + "countries": [ + "Argentina" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q6053873", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 66, + "pctDepth": 28, + "pctReach": 23, + "fame": 39, + "magnitude": 2 + }, + "description": "Argentine journalist and radio host (1951–2026)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000246570", + "pageId": 2385264, + "revisionId": 1334637363, + "title": "Ofanto", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "River in Italy", + "connect": { + "countries": [ + "Italy" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4022" + ], + "qid": "Q841550", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 69, + "pctDepth": 43, + "pctReach": 91, + "fame": 68, + "magnitude": 3 + }, + "description": "River in Italy" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000751b4c", + "pageId": 7674700, + "revisionId": 1384061257, + "title": "Shipley Plateau", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Place in the Blue Mountains, Australia", + "connect": { + "countries": [ + "Australia", + "United Kingdom" + ], + "centuries": [], + "links": [], + "p31": [ + "Q75520" + ], + "qid": "Q7498025", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 17, + "pctDepth": 7, + "pctReach": 23, + "fame": 16, + "magnitude": 1 + }, + "description": "Place in the Blue Mountains, Australia" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000140afac", + "pageId": 21016492, + "revisionId": 1363646521, + "title": "Xiancantan", + "type": "Location", + "subtype": null, + "portal": "Science", + "cost": 2, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "", + "connect": { + "countries": [ + "China" + ], + "centuries": [ + 18 + ], + "links": [], + "p31": [ + "Q41176" + ], + "qid": "Q434483", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 50, + "pctDepth": 7, + "pctReach": 67, + "fame": 41, + "magnitude": 2 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003165b05", + "pageId": 51796741, + "revisionId": 1356084913, + "title": "Alex Piquero", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 3, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Stub" + ], + "effects": [], + "rulesText": "Protected, Stub.", + "flavor": "Cuban-American criminologist (born 1970)", + "connect": { + "countries": [ + "Cuba", + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q27058048", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 62, + "pctDepth": 59, + "pctReach": 8, + "fame": 43, + "magnitude": 2 + }, + "description": "Cuban-American criminologist (born 1970)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000183a95", + "pageId": 1587861, + "revisionId": 1382422731, + "title": "VΓ©lez-MΓ‘laga", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Place in MΓ‘laga, Spain", + "connect": { + "countries": [ + "Spain" + ], + "centuries": [], + "links": [], + "p31": [ + "Q2074737" + ], + "qid": "Q492741", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 86, + "pctDepth": 92, + "pctReach": 98, + "fame": 92, + "magnitude": 3 + }, + "description": "Place in MΓ‘laga, Spain" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000041756b", + "pageId": 4289899, + "revisionId": 1384682008, + "title": "Anthodon (reptile)", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 5, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Translated" + ], + "effects": [], + "rulesText": "Translated.", + "flavor": "Extinct genus of reptiles", + "connect": { + "countries": [], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q47487597" + ], + "qid": "Q2505064", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 69, + "pctDepth": 64, + "pctReach": 80, + "fame": 71, + "magnitude": 3 + }, + "description": "Extinct genus of reptiles" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000010b1fc1", + "pageId": 17506241, + "revisionId": 1361257647, + "title": "Marion Thees", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 3, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Translated" + ], + "effects": [], + "rulesText": "Protected, Translated.", + "flavor": "German skeleton racer", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q72724", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 38, + "pctDepth": 23, + "pctReach": 78, + "fame": 46, + "magnitude": 2 + }, + "description": "German skeleton racer" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000013be088", + "pageId": 20701320, + "revisionId": 1385997032, + "title": "Horse Feathers (band)", + "type": "Institution", + "subtype": "organisation", + "portal": "Arts", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "American indie folk band", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q215380" + ], + "qid": "Q5905442", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 71, + "pctDepth": 54, + "pctReach": 36, + "fame": 54, + "magnitude": 2 + }, + "description": "American indie folk band" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002d92236", + "pageId": 47784502, + "revisionId": 1375411209, + "title": "Christian ZΓΌbert", + "type": "Figure", + "subtype": null, + "portal": "Arts", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "German film director and screenwriter (born 1973)", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q1082448", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 59, + "pctReach": 58, + "fame": 55, + "magnitude": 2 + }, + "description": "German film director and screenwriter (born 1973)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003d70634", + "pageId": 64423476, + "revisionId": 1377264425, + "title": "2023 Seville municipal election", + "type": "Event", + "subtype": "election", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "createToken", + "amount": 2, + "token": { + "name": "Elected Member", + "power": 1, + "toughness": 1, + "portal": "Society" + }, + "template": "T5" + } + ], + "rulesText": "Create two 1/1 Society Figure tokens named Elected Member.", + "flavor": "Election in the Spanish municipality of Seville", + "connect": { + "countries": [ + "Spain" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q152450" + ], + "qid": "Q97188845", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 52, + "pctDepth": 97, + "pctReach": 36, + "fame": 62, + "magnitude": 2 + }, + "description": "Election in the Spanish municipality of Seville" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000049c9880", + "pageId": 77371520, + "revisionId": 1372235441, + "title": "CoaliciΓ³n Vamos", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Political party in Panama", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q7278" + ], + "qid": "Q127386808", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 85, + "pctDepth": 28, + "pctReach": 23, + "fame": 45, + "magnitude": 2 + }, + "description": "Political party in Panama" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000001c2f8", + "pageId": 115448, + "revisionId": 1374535006, + "title": "Mackville, Kentucky", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "City in Kentucky, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1093829" + ], + "qid": "Q2246158", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 50, + "pctDepth": 54, + "pctReach": 94, + "fame": 66, + "magnitude": 3 + }, + "description": "City in Kentucky, United States" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000041fc69", + "pageId": 4324457, + "revisionId": 1372952688, + "title": "Juha Suoranta", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 2, + "toughness": 3, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Finnish social scientist", + "connect": { + "countries": [ + "Finland" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q6305056", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 68, + "pctReach": 47, + "fame": 50, + "magnitude": 2 + }, + "description": "Finnish social scientist" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000908a9f", + "pageId": 9472671, + "revisionId": 1280127322, + "title": "Fletcher (typeface)", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "Serif typeface", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q17451" + ], + "qid": "Q2539914", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 54, + "pctDepth": 2, + "pctReach": 23, + "fame": 26, + "magnitude": 1 + }, + "description": "Serif typeface" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000befc0f", + "pageId": 12516367, + "revisionId": 1320927031, + "title": "Frogham, Kent", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Hamlet in Kent, England", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [], + "links": [], + "p31": [ + "Q5084" + ], + "qid": "Q5505274", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 21, + "pctDepth": 4, + "pctReach": 47, + "fame": 24, + "magnitude": 1 + }, + "description": "Hamlet in Kent, England" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000181aa81", + "pageId": 25275009, + "revisionId": 1381503728, + "title": "Amur Annexation", + "type": "Event", + "subtype": "conflict", + "portal": "History", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "damage", + "target": "figureOrLocation", + "amount": 4, + "template": "T3" + } + ], + "rulesText": "Deal 4 damage to target Figure or Location.", + "flavor": "Russian annexation of Outer Manchuria", + "connect": { + "countries": [ + "China", + "Russia" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q194465" + ], + "qid": "Q4379152", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 93, + "pctDepth": 81, + "pctReach": 74, + "fame": 83, + "magnitude": 3 + }, + "description": "Russian annexation of Outer Manchuria" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001fbc437", + "pageId": 33276983, + "revisionId": 1375320562, + "title": "Buky", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Rural locality in Cherkasy Oblast, Ukraine", + "connect": { + "countries": [ + "Ukraine" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4100864", + "Q486972" + ], + "qid": "Q2473493", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 38, + "pctDepth": 33, + "pctReach": 83, + "fame": 51, + "magnitude": 2 + }, + "description": "Rural locality in Cherkasy Oblast, Ukraine" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000256bae2", + "pageId": 39238370, + "revisionId": 1330396969, + "title": "2013 San Jose State Spartans football team", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 2, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +2/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "American college football season", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q26895936" + ], + "qid": "Q16972991", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 62, + "pctDepth": 83, + "pctReach": 8, + "fame": 51, + "magnitude": 2 + }, + "description": "American college football season" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002c1eb97", + "pageId": 46263191, + "revisionId": 1384441370, + "title": "Max Touloute", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 2, + "toughness": 3, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Haitian footballer (born 1990)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q20641573", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 68, + "pctReach": 36, + "fame": 46, + "magnitude": 2 + }, + "description": "Haitian footballer (born 1990)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002fdc661", + "pageId": 50185825, + "revisionId": 1371365886, + "title": "Majid Qodiri", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 4, + "power": 2, + "toughness": 5, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "Uzbek literary scholar and educator (1886–1938)", + "connect": { + "countries": [], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q23823703", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 31, + "pctDepth": 64, + "pctReach": 63, + "fame": 53, + "magnitude": 2 + }, + "description": "Uzbek literary scholar and educator (1886–1938)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000321b424", + "pageId": 52540452, + "revisionId": 1381108921, + "title": "Olga Gorshenina", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Translated" + ], + "effects": [], + "rulesText": "Protected, Translated.", + "flavor": "Russian handball player", + "connect": { + "countries": [ + "Germany", + "Hungary", + "Romania", + "Russia" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q2019617", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 14, + "pctDepth": 17, + "pctReach": 78, + "fame": 36, + "magnitude": 1 + }, + "description": "Russian handball player" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000043bf4f0", + "pageId": 71038192, + "revisionId": 1382877416, + "title": "1952 Avusrennen", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 1, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 1, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +1/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "Motor car race", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q112838670", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 24, + "pctDepth": 38, + "pctReach": 8, + "fame": 23, + "magnitude": 1 + }, + "description": "Motor car race" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004d8d1a8", + "pageId": 81318312, + "revisionId": 1382049023, + "title": "Guido IvΓ‘n Justo", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 4, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Featured" + ], + "effects": [], + "rulesText": "Protected, Featured.", + "flavor": "Argentine tennis player (born 1997)", + "connect": { + "countries": [ + "Argentina" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q138414200", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 85, + "pctDepth": 54, + "pctReach": 23, + "fame": 54, + "magnitude": 2 + }, + "description": "Argentine tennis player (born 1997)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000021dbee", + "pageId": 2218990, + "revisionId": 1386025479, + "title": "Deputy Prime Minister of Malaysia", + "type": "Institution", + "subtype": "other", + "portal": "Society", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 0, + "condition": { + "maxPower": 2 + }, + "template": "T10" + } + ], + "rulesText": "Figures you control with power 2 or less get +1/+0.", + "flavor": "Political office in Malaysia", + "connect": { + "countries": [ + "Malaysia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4164871" + ], + "qid": "Q5261073", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 89, + "pctDepth": 86, + "pctReach": 76, + "fame": 84, + "magnitude": 3 + }, + "description": "Political office in Malaysia" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000007e454c", + "pageId": 8275276, + "revisionId": 1350443233, + "title": "Thomas Wharton Jr.", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 5, + "toughness": 4, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "American politician (1735–1778)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 18 + ], + "links": [], + "p31": [], + "qid": "Q883460", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 79, + "pctDepth": 73, + "pctReach": 36, + "fame": 63, + "magnitude": 3 + }, + "description": "American politician (1735–1778)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001462f3f", + "pageId": 21376831, + "revisionId": 1374494957, + "title": "Bez (DrΓ΄me)", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "River in France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4022" + ], + "qid": "Q1019347", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 17, + "pctDepth": 7, + "pctReach": 36, + "fame": 20, + "magnitude": 1 + }, + "description": "River in France" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000155d87e", + "pageId": 22403198, + "revisionId": 1375646501, + "title": "Cioc-Maidan", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Commune in Gagauzia, Moldova", + "connect": { + "countries": [ + "Moldova" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4229812", + "Q532" + ], + "qid": "Q2639022", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 28, + "pctReach": 80, + "fame": 48, + "magnitude": 2 + }, + "description": "Commune in Gagauzia, Moldova" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000015797a4", + "pageId": 22517668, + "revisionId": 1244289559, + "title": "Kwong Wai Siew Peck San Theng", + "type": "Location", + "subtype": null, + "portal": "Science", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Columbarium in Singapore", + "connect": { + "countries": [ + "Singapore" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q6450554", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 74, + "pctDepth": 54, + "pctReach": 23, + "fame": 50, + "magnitude": 2 + }, + "description": "Columbarium in Singapore" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002d51886", + "pageId": 47519878, + "revisionId": 1382761423, + "title": "Jeanne Madden", + "type": "Figure", + "subtype": null, + "portal": "Arts", + "cost": 2, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy", + "Stub" + ], + "effects": [], + "rulesText": "Legacy, Stub.", + "flavor": "American singer and actress (1917–1989)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q20974011", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 7, + "pctReach": 53, + "fame": 27, + "magnitude": 1 + }, + "description": "American singer and actress (1917–1989)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002e752d2", + "pageId": 48714450, + "revisionId": 1383721847, + "title": "Payam Heydari", + "type": "Figure", + "subtype": null, + "portal": "Science", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Iranian-American Professor", + "connect": { + "countries": [ + "Iran", + "United States" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q22097382", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 73, + "pctReach": 36, + "fame": 56, + "magnitude": 2 + }, + "description": "Iranian-American Professor" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004b36e3e", + "pageId": 78868030, + "revisionId": 1327239041, + "title": "Mercenasco Castle", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Building in Mercenasco, Italy", + "connect": { + "countries": [ + "Italy" + ], + "centuries": [], + "links": [], + "p31": [ + "Q23413" + ], + "qid": "Q131729377", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 0, + "pctDepth": 17, + "pctReach": 36, + "fame": 18, + "magnitude": 1 + }, + "description": "Building in Mercenasco, Italy" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000050afd22", + "pageId": 84606242, + "revisionId": 1382829231, + "title": "Edward Ellsworth Underwood", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 2, + "toughness": 3, + "territory": 0, + "keywords": [ + "Legacy", + "Local" + ], + "effects": [], + "rulesText": "Legacy, Local.", + "flavor": "American physician (1864–1942)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q141822855", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 50, + "pctDepth": 59, + "pctReach": 8, + "fame": 39, + "magnitude": 2 + }, + "description": "American physician (1864–1942)" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000000ef95c", + "pageId": 981340, + "revisionId": 1384823392, + "title": "Tatsunoko Production", + "type": "Institution", + "subtype": "organisation", + "portal": "Arts", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Japanese animation studio", + "connect": { + "countries": [ + "Japan" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q1107679" + ], + "qid": "Q1323459", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 94, + "pctDepth": 98, + "pctReach": 86, + "fame": 93, + "magnitude": 3 + }, + "description": "Japanese animation studio" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000001ed529", + "pageId": 2020649, + "revisionId": 1356568738, + "title": "Luxury box", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Society", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.", + "flavor": "Class of seating in arena or stadium", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q852359", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "description", + "basis": { + "pctAttention": 87, + "pctDepth": 83, + "pctReach": 63, + "fame": 78, + "magnitude": 3 + }, + "description": "Class of seating in arena or stadium" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000002d7151", + "pageId": 2978129, + "revisionId": 1354827085, + "title": "Saraca", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 4, + "power": 5, + "toughness": 3, + "territory": 0, + "keywords": [ + "Translated" + ], + "effects": [], + "rulesText": "Translated.", + "flavor": "Genus of legumes", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q2426272", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 33, + "pctReach": 86, + "fame": 59, + "magnitude": 2 + }, + "description": "Genus of legumes" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000d65bfa", + "pageId": 14048250, + "revisionId": 1377607311, + "title": "Frontier, Saskatchewan", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Village in Saskatchewan, Canada", + "connect": { + "countries": [ + "Canada" + ], + "centuries": [], + "links": [], + "p31": [ + "Q6644778" + ], + "qid": "Q2003391", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 66, + "pctDepth": 77, + "pctReach": 47, + "fame": 63, + "magnitude": 3 + }, + "description": "Village in Saskatchewan, Canada" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001d1c4f7", + "pageId": 30524663, + "revisionId": 1321144611, + "title": "Aichi AB-2", + "type": "Institution", + "subtype": "organisation", + "portal": "Science", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Prototype reconnaissance floatplane", + "connect": { + "countries": [ + "Japan" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q15056995" + ], + "qid": "Q4696551", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 47, + "pctDepth": 43, + "pctReach": 47, + "fame": 46, + "magnitude": 2 + }, + "description": "Prototype reconnaissance floatplane" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001d6c6e5", + "pageId": 30852837, + "revisionId": 1366643102, + "title": "Symphodus", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 4, + "power": 4, + "toughness": 4, + "territory": 0, + "keywords": [ + "Translated", + "Stub" + ], + "effects": [], + "rulesText": "Translated, Stub.", + "flavor": "Genus of fishes", + "connect": { + "countries": [ + "Spain" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q2019861", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 48, + "pctReach": 89, + "fame": 61, + "magnitude": 2 + }, + "description": "Genus of fishes" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000028ca141", + "pageId": 42770753, + "revisionId": 1375492681, + "title": "ChΓ’teau de la Faye (Villexavier)", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Manor house in Charente-Maritime, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q23413" + ], + "qid": "Q2971223", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 9, + "pctDepth": 7, + "pctReach": 23, + "fame": 13, + "magnitude": 1 + }, + "description": "Manor house in Charente-Maritime, France" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002e6632d", + "pageId": 48653101, + "revisionId": 1381828221, + "title": "Tornadoes of 1978", + "type": "Event", + "subtype": "disaster", + "portal": "Neutral", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "damageEach", + "target": "each", + "amount": 1, + "template": "T4" + } + ], + "rulesText": "Deal 1 damage to each Figure and each Location.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q18340514" + ], + "qid": "Q22093730", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 80, + "pctDepth": 81, + "pctReach": 8, + "fame": 56, + "magnitude": 2 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000034881ec", + "pageId": 55083500, + "revisionId": 1383844197, + "title": "United Kingdom House", + "type": "Location", + "subtype": null, + "portal": "Science", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Building on Oxford Street, London, England", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q41176" + ], + "qid": "Q26319049", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 54, + "pctDepth": 23, + "pctReach": 23, + "fame": 33, + "magnitude": 1 + }, + "description": "Building on Oxford Street, London, England" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000337786", + "pageId": 3372934, + "revisionId": 1364063954, + "title": "Hermes RamΓ­rez", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Legacy", + "Translated" + ], + "effects": [], + "rulesText": "Legacy, Translated.", + "flavor": "Cuban sprinter (1948–2024)", + "connect": { + "countries": [ + "Cuba", + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q522855", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 59, + "pctReach": 81, + "fame": 61, + "magnitude": 2 + }, + "description": "Cuban sprinter (1948–2024)" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000007f4694", + "pageId": 8341140, + "revisionId": 1370304900, + "title": "CeauΘ™escu family", + "type": "Figure", + "subtype": null, + "portal": "Neutral", + "cost": 5, + "power": 5, + "toughness": 4, + "territory": 0, + "keywords": [ + "Featured" + ], + "effects": [], + "rulesText": "Featured.", + "flavor": "Family of Nicolae CeauΘ™escu", + "connect": { + "countries": [ + "Romania" + ], + "centuries": [], + "links": [], + "p31": [ + "Q8436" + ], + "qid": "Q5055770", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 92, + "pctDepth": 59, + "pctReach": 47, + "fame": 66, + "magnitude": 3 + }, + "description": "Family of Nicolae CeauΘ™escu" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000d29182", + "pageId": 13799810, + "revisionId": 1374230485, + "title": "Levophacetoperane", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Science", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 2, + "toughness": 2, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +2/+2.", + "flavor": "Stimulant drug", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q113145171" + ], + "qid": "Q6535818", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 64, + "pctDepth": 38, + "pctReach": 36, + "fame": 46, + "magnitude": 2 + }, + "description": "Stimulant drug" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000010eef0c", + "pageId": 17755916, + "revisionId": 1360992742, + "title": "Xiaoliang Sunney Xie", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 4, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected", + "Well-sourced" + ], + "effects": [], + "rulesText": "Protected, Well-sourced.", + "flavor": "Chinese-American biochemist", + "connect": { + "countries": [ + "China", + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q906616", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 74, + "pctDepth": 93, + "pctReach": 58, + "fame": 75, + "magnitude": 3 + }, + "description": "Chinese-American biochemist" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001225032", + "pageId": 19025970, + "revisionId": 1385734329, + "title": "Marina Kuzina", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 3, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected", + "Translated" + ], + "effects": [], + "rulesText": "Protected, Translated.", + "flavor": "Russian basketball player", + "connect": { + "countries": [ + "Russia" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q2704942", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 11, + "pctReach": 86, + "fame": 39, + "magnitude": 2 + }, + "description": "Russian basketball player" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000016ff42e", + "pageId": 24114222, + "revisionId": 1317119586, + "title": "Rum cake", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.", + "flavor": "Type of dessert", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q7379109", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 90, + "pctDepth": 38, + "pctReach": 71, + "fame": 66, + "magnitude": 3 + }, + "description": "Type of dessert" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001e1e5e4", + "pageId": 31581668, + "revisionId": 1377811586, + "title": "Ian Potter Museum of Art", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Art museum in Parkville, Victoria", + "connect": { + "countries": [ + "Australia" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q207694" + ], + "qid": "Q5982619", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 62, + "pctDepth": 68, + "pctReach": 36, + "fame": 55, + "magnitude": 2 + }, + "description": "Art museum in Parkville, Victoria" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001ff532a", + "pageId": 33510186, + "revisionId": 1371413731, + "title": "Piet Hesse", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 2, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "Dutch actor and comedian (1872–1936)", + "connect": { + "countries": [ + "Netherlands" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q2513810", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 17, + "pctDepth": 23, + "pctReach": 53, + "fame": 31, + "magnitude": 1 + }, + "description": "Dutch actor and comedian (1872–1936)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000212369d", + "pageId": 34748061, + "revisionId": 1315380924, + "title": "Goneplax", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 1, + "toughness": 3, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Genus of crabs", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q5234395", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 4, + "pctDepth": 14, + "pctReach": 71, + "fame": 30, + "magnitude": 1 + }, + "description": "Genus of crabs" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002d706ce", + "pageId": 47646414, + "revisionId": 1384401817, + "title": "John Mellencamp Pavilion", + "type": "Location", + "subtype": null, + "portal": "Society", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "American athletics facility at Indiana University Bloomington", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q41176" + ], + "qid": "Q22097461", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 71, + "pctDepth": 33, + "pctReach": 8, + "fame": 37, + "magnitude": 1 + }, + "description": "American athletics facility at Indiana University Bloomington" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003853be9", + "pageId": 59063273, + "revisionId": 1385547666, + "title": "Nathan M. Johnson", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 4, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected", + "Featured" + ], + "effects": [], + "rulesText": "Protected, Featured.", + "flavor": "American politician and composer (born 1968)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q58756295", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 98, + "pctDepth": 89, + "pctReach": 23, + "fame": 70, + "magnitude": 3 + }, + "description": "American politician and composer (born 1968)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003a79927", + "pageId": 61315367, + "revisionId": 1380314462, + "title": "Payson J. Treat", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 1, + "power": 1, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy", + "Stub" + ], + "effects": [], + "rulesText": "Legacy, Stub.", + "flavor": "American Japanologist (1879–1972)", + "connect": { + "countries": [ + "Japan", + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q59628931", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 11, + "pctDepth": 38, + "pctReach": 8, + "fame": 19, + "magnitude": 1 + }, + "description": "American Japanologist (1879–1972)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000179138", + "pageId": 1544504, + "revisionId": 1384187229, + "title": "Walter Rauschenbusch", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Featured", + "Legacy" + ], + "effects": [], + "rulesText": "Featured, Legacy.", + "flavor": "American theologian and Baptist pastor (1861-1918)", + "connect": { + "countries": [ + "Germany", + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q1345238", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 89, + "pctDepth": 90, + "pctReach": 86, + "fame": 88, + "magnitude": 3 + }, + "description": "American theologian and Baptist pastor (1861-1918)" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000002518b4", + "pageId": 2431156, + "revisionId": 1368504160, + "title": "Organization of the Luftwaffe (1933–1945)", + "type": "Institution", + "subtype": "organisation", + "portal": "Science", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Structure of German air force", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q15627509" + ], + "qid": "Q636182", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 89, + "pctDepth": 98, + "pctReach": 67, + "fame": 85, + "magnitude": 3 + }, + "description": "Structure of German air force" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000006af267", + "pageId": 7008871, + "revisionId": 1382159622, + "title": "Duke Blue Devils football", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Football team of Duke University", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q17156793", + "Q18558301" + ], + "qid": "Q5312733", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 98, + "pctDepth": 98, + "pctReach": 36, + "fame": 77, + "magnitude": 3 + }, + "description": "Football team of Duke University" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000a9306d", + "pageId": 11087981, + "revisionId": 1383233544, + "title": "SREBP cleavage-activating protein", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Science", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 2, + "toughness": 2, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +2/+2.", + "flavor": "Protein-coding gene in the species Homo sapiens", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q7187" + ], + "qid": "Q14913782", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 68, + "pctReach": 36, + "fame": 49, + "magnitude": 2 + }, + "description": "Protein-coding gene in the species Homo sapiens" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000e463d7", + "pageId": 14967767, + "revisionId": 1346472302, + "title": "Everton, Nottinghamshire", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Village and civil parish in Nottinghamshire, England", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1115575", + "Q532" + ], + "qid": "Q5417389", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 50, + "pctDepth": 54, + "pctReach": 63, + "fame": 56, + "magnitude": 2 + }, + "description": "Village and civil parish in Nottinghamshire, England" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001625b83", + "pageId": 23223171, + "revisionId": 1351215348, + "title": "Plectania", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 4, + "power": 3, + "toughness": 5, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Genus of fungi", + "connect": { + "countries": [], + "centuries": [ + 19 + ], + "links": [], + "p31": [], + "qid": "Q5235905", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 31, + "pctDepth": 54, + "pctReach": 67, + "fame": 51, + "magnitude": 2 + }, + "description": "Genus of fungi" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000229b4e9", + "pageId": 36287721, + "revisionId": 1364688814, + "title": "Magheracross", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Townland in County Fermanagh, Northern Ireland", + "connect": { + "countries": [ + "Ireland" + ], + "centuries": [], + "links": [], + "p31": [ + "Q2151232" + ], + "qid": "Q6730410", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 27, + "pctDepth": 59, + "pctReach": 8, + "fame": 31, + "magnitude": 1 + }, + "description": "Townland in County Fermanagh, Northern Ireland" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003256025", + "pageId": 52781093, + "revisionId": 1360733771, + "title": "SS Iberia (1873)", + "type": "Institution", + "subtype": "other", + "portal": "History", + "cost": 1, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 0, + "condition": { + "maxPower": 2 + }, + "template": "T10" + } + ], + "rulesText": "Figures you control with power 2 or less get +1/+0.", + "flavor": "Steamship by John Elder", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q12859788" + ], + "qid": "Q28232395", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 27, + "pctDepth": 17, + "pctReach": 8, + "fame": 17, + "magnitude": 1 + }, + "description": "Steamship by John Elder" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000004cc4", + "pageId": 19652, + "revisionId": 1382146482, + "title": "Monoid", + "type": "Doctrine", + "subtype": "mathematics", + "portal": "Science", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "grant": [ + "Well-sourced" + ], + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3 and has Well-sourced.", + "flavor": "Algebraic structure with an associative operation and an identity element", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q208237", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 97, + "pctDepth": 93, + "pctReach": 98, + "fame": 96, + "magnitude": 3 + }, + "description": "Algebraic structure with an associative operation and an identity element" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000004bb672", + "pageId": 4961906, + "revisionId": 1343697567, + "title": "Chinese star maps", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Science", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.", + "flavor": "Depictions of the positions of stars on the celestial sphere", + "connect": { + "countries": [ + "China" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q16241158", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 79, + "pctDepth": 90, + "pctReach": 36, + "fame": 68, + "magnitude": 3 + }, + "description": "Depictions of the positions of stars on the celestial sphere" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000008b571b", + "pageId": 9131803, + "revisionId": 1351670352, + "title": "Shooting at the 1912 Summer Olympics – Men's 30 metre rapid fire pistol", + "type": "Event", + "subtype": "other", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "draw", + "amount": 2, + "template": "T7" + } + ], + "rulesText": "Draw two cards.", + "flavor": "Olympic shooting event", + "connect": { + "countries": [], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q18536594" + ], + "qid": "Q7500632", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 31, + "pctDepth": 68, + "pctReach": 58, + "fame": 52, + "magnitude": 2 + }, + "description": "Olympic shooting event" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000b8fc3c", + "pageId": 12123196, + "revisionId": 1362893730, + "title": "Phu Phra Bat Buabok Forest Park", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Forest park in Ban Phue District, Thailand", + "connect": { + "countries": [ + "Thailand" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q13020522" + ], + "qid": "Q250022", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 27, + "pctDepth": 17, + "pctReach": 36, + "fame": 27, + "magnitude": 1 + }, + "description": "Forest park in Ban Phue District, Thailand" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000e67fba", + "pageId": 15105978, + "revisionId": 1384889405, + "title": "Well", + "type": "Doctrine", + "subtype": "mathematics", + "portal": "Science", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "grant": [ + "Well-sourced" + ], + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3 and has Well-sourced.", + "flavor": "Excavation or structure to provide access to groundwater", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q43483", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "description", + "basis": { + "pctAttention": 97, + "pctDepth": 95, + "pctReach": 99, + "fame": 97, + "magnitude": 3 + }, + "description": "Excavation or structure to provide access to groundwater" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002e39459", + "pageId": 48469081, + "revisionId": 1373109716, + "title": "Dr. John L. Butler House", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Historic house in Arkansas, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q3947" + ], + "qid": "Q24041379", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 3, + "pctDepth": 14, + "pctReach": 8, + "fame": 8, + "magnitude": 1 + }, + "description": "Historic house in Arkansas, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003f34d76", + "pageId": 66276726, + "revisionId": 1326195763, + "title": "Inaechelys", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Genus of reptiles", + "connect": { + "countries": [ + "Brazil" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q23038290" + ], + "qid": "Q26700596", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 27, + "pctDepth": 11, + "pctReach": 23, + "fame": 20, + "magnitude": 1 + }, + "description": "Genus of reptiles" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004dba1f0", + "pageId": 81502704, + "revisionId": 1373685251, + "title": "Wenshet", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 3, + "power": 3, + "toughness": 3, + "territory": 0, + "keywords": [], + "effects": [], + "rulesText": "", + "flavor": "", + "connect": { + "countries": [ + "Egypt" + ], + "centuries": [ + 26 + ], + "links": [], + "p31": [], + "qid": "Q2559642", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 48, + "pctReach": 53, + "fame": 45, + "magnitude": 2 + } + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000020ac39", + "pageId": 2141241, + "revisionId": 1381701379, + "title": "Hvis lyset tar oss", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "1994 studio album by Burzum", + "connect": { + "countries": [ + "Norway" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q482994" + ], + "qid": "Q1129211", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 93, + "pctDepth": 48, + "pctReach": 90, + "fame": 77, + "magnitude": 3 + }, + "description": "1994 studio album by Burzum" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000003efcc4", + "pageId": 4127940, + "revisionId": 1376763672, + "title": "Lunugala", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Town in Uva Province, Sri Lanka", + "connect": { + "countries": [ + "Sri Lanka" + ], + "centuries": [], + "links": [], + "p31": [ + "Q486972" + ], + "qid": "Q6704475", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 54, + "pctDepth": 43, + "pctReach": 36, + "fame": 44, + "magnitude": 2 + }, + "description": "Town in Uva Province, Sri Lanka" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000ec5681", + "pageId": 15488641, + "revisionId": 1384010653, + "title": "Dominique Rodgers-Cromartie", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected", + "Featured" + ], + "effects": [], + "rulesText": "Protected, Featured.", + "flavor": "American football player (born 1986)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q434024", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 94, + "pctDepth": 97, + "pctReach": 58, + "fame": 83, + "magnitude": 3 + }, + "description": "American football player (born 1986)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001774450", + "pageId": 24593488, + "revisionId": 1379665199, + "title": "Ε½iΕΎki", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Place in Prekmurje, Slovenia", + "connect": { + "countries": [ + "Slovenia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q486972" + ], + "qid": "Q280193", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 38, + "pctReach": 84, + "fame": 48, + "magnitude": 2 + }, + "description": "Place in Prekmurje, Slovenia" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003115e59", + "pageId": 51469913, + "revisionId": 1364729120, + "title": "Beaconsfield Station Sheep Wash", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Historic site in Queensland, Australia", + "connect": { + "countries": [ + "Australia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1081138" + ], + "qid": "Q28035337", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 9, + "pctDepth": 73, + "pctReach": 8, + "fame": 30, + "magnitude": 1 + }, + "description": "Historic site in Queensland, Australia" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000032f1880", + "pageId": 53418112, + "revisionId": 1383301063, + "title": "2012 United States presidential straw poll in Guam", + "type": "Event", + "subtype": "election", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "createToken", + "amount": 2, + "token": { + "name": "Elected Member", + "power": 1, + "toughness": 1, + "portal": "Society" + }, + "template": "T5" + } + ], + "rulesText": "Create two 1/1 Society Figure tokens named Elected Member.", + "flavor": "", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q858439" + ], + "qid": "Q29097654", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 64, + "pctDepth": 59, + "pctReach": 8, + "fame": 44, + "magnitude": 2 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000033fcb23", + "pageId": 54512419, + "revisionId": 1282834290, + "title": "Elephant Square", + "type": "Location", + "subtype": null, + "portal": "Science", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q174782", + "Q1788454" + ], + "qid": "Q39046311", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 64, + "pctDepth": 17, + "pctReach": 23, + "fame": 35, + "magnitude": 1 + } + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000387d360", + "pageId": 59233120, + "revisionId": 1316504057, + "title": "Maryland Independent", + "type": "Institution", + "subtype": "work", + "portal": "Neutral", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "Semi-weekly newspaper published in Waldorf, Maryland, US", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q11032" + ], + "qid": "Q55667255", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 31, + "pctDepth": 54, + "pctReach": 8, + "fame": 31, + "magnitude": 1 + }, + "description": "Semi-weekly newspaper published in Waldorf, Maryland, US" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004a88b48", + "pageId": 78154568, + "revisionId": 1384643280, + "title": "Lithodes mamillifer", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of king crab", + "connect": { + "countries": [ + "India" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q13768243", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 9, + "pctDepth": 4, + "pctReach": 23, + "fame": 12, + "magnitude": 1 + }, + "description": "Species of king crab" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000002061e", + "pageId": 132638, + "revisionId": 1375881246, + "title": "Perry Township, Greene County, Pennsylvania", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Township in Pennsylvania, US", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q9035798" + ], + "qid": "Q5809786", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 42, + "pctDepth": 59, + "pctReach": 63, + "fame": 55, + "magnitude": 2 + }, + "description": "Township in Pennsylvania, US" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000000d1815", + "pageId": 858133, + "revisionId": 1261572264, + "title": "Ashley (automobile)", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "British manufacturers of car body shells & chassis for specials (1955-1962)", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q786820" + ], + "qid": "Q725930", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 66, + "pctDepth": 54, + "pctReach": 36, + "fame": 52, + "magnitude": 2 + }, + "description": "British manufacturers of car body shells & chassis for specials (1955-1962)" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000010c9c6d", + "pageId": 17603693, + "revisionId": 1339376467, + "title": "Bad Little Angel", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "1939 film by Wilhelm Thiele", + "connect": { + "countries": [ + "United Kingdom", + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q11424" + ], + "qid": "Q2483475", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 66, + "pctDepth": 23, + "pctReach": 36, + "fame": 42, + "magnitude": 2 + }, + "description": "1939 film by Wilhelm Thiele" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000015e910f", + "pageId": 22974735, + "revisionId": 1374856654, + "title": "Christianity in the 5th century", + "type": "Event", + "subtype": "other", + "portal": "Neutral", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "draw", + "amount": 3, + "template": "T7" + } + ], + "rulesText": "Draw three cards.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [ + 5 + ], + "links": [], + "p31": [ + "Q18340514" + ], + "qid": "Q5110603", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 79, + "pctDepth": 94, + "pctReach": 36, + "fame": 70, + "magnitude": 3 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000018c3734", + "pageId": 25966388, + "revisionId": 1329232874, + "title": "Phacelia quickii", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of plant", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q7179927", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 3, + "pctDepth": 11, + "pctReach": 47, + "fame": 20, + "magnitude": 1 + }, + "description": "Species of plant" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002217317", + "pageId": 35746583, + "revisionId": 1346095921, + "title": "Barbajada", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 2, + "toughness": 2, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +2/+2.", + "flavor": "Italian chocolate coffee drink", + "connect": { + "countries": [ + "Italy" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q3634571", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 74, + "pctDepth": 17, + "pctReach": 58, + "fame": 50, + "magnitude": 2 + }, + "description": "Italian chocolate coffee drink" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000023d5c96", + "pageId": 37575830, + "revisionId": 1385253370, + "title": "Γ–zkan YΔ±ldΔ±rΔ±m", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 2, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "German footballer", + "connect": { + "countries": [ + "Germany", + "Turkey" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q1152151", + "cites": [] + }, + "rarity": "Legendary", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 24, + "pctDepth": 54, + "pctReach": 74, + "fame": 51, + "magnitude": 2 + }, + "description": "German footballer" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003d66226", + "pageId": 64381478, + "revisionId": 1381097840, + "title": "Denis Zabolotin", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 1, + "power": 1, + "toughness": 1, + "territory": 0, + "keywords": [ + "Protected", + "Stub" + ], + "effects": [], + "rulesText": "Protected, Stub.", + "flavor": "Russian handball player", + "connect": { + "countries": [ + "Russia" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q96644151", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 14, + "pctReach": 36, + "fame": 24, + "magnitude": 1 + }, + "description": "Russian handball player" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003eadb6d", + "pageId": 65723245, + "revisionId": 1380335385, + "title": "Russell A. Sanborn", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 3, + "power": 2, + "toughness": 3, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "U.S. Marine major general", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q29852979", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 54, + "pctDepth": 73, + "pctReach": 23, + "fame": 50, + "magnitude": 2 + }, + "description": "U.S. Marine major general" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004e3418c", + "pageId": 82002316, + "revisionId": 1357961360, + "title": "Taupo Totara Timber Company", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "New Zealand timber and building supplies company", + "connect": { + "countries": [ + "New Zealand" + ], + "centuries": [], + "links": [], + "p31": [ + "Q783794" + ], + "qid": "Q138001385", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 90, + "pctReach": 8, + "fame": 47, + "magnitude": 2 + }, + "description": "New Zealand timber and building supplies company" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000129da3", + "pageId": 1220003, + "revisionId": 1381976644, + "title": "Robert Hawthorne", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Legacy", + "Local" + ], + "effects": [], + "rulesText": "Legacy, Local.", + "flavor": "Recipient of the Victoria Cross", + "connect": { + "countries": [ + "India", + "Ireland", + "United Kingdom" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [], + "qid": "Q3681767", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 76, + "pctDepth": 77, + "pctReach": 8, + "fame": 54, + "magnitude": 2 + }, + "description": "Recipient of the Victoria Cross" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000134dd65", + "pageId": 20241765, + "revisionId": 1362148473, + "title": "Imre SzΓΆllΕ‘si", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 1, + "toughness": 4, + "territory": 0, + "keywords": [ + "Legacy", + "Translated" + ], + "effects": [], + "rulesText": "Legacy, Translated.", + "flavor": "Hungarian canoeist (1941–2022)", + "connect": { + "countries": [ + "Hungary" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q6008352", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 11, + "pctDepth": 33, + "pctReach": 82, + "fame": 42, + "magnitude": 2 + }, + "description": "Hungarian canoeist (1941–2022)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000182777d", + "pageId": 25327485, + "revisionId": 1378155021, + "title": "Marc Fesneau", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 5, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "French politician (born 1971)", + "connect": { + "countries": [ + "France" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q6755549", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 76, + "pctDepth": 68, + "pctReach": 63, + "fame": 69, + "magnitude": 3 + }, + "description": "French politician (born 1971)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000279e59b", + "pageId": 41543067, + "revisionId": 1381927878, + "title": "Arms and the Girl", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "1917 American silent film", + "connect": { + "countries": [ + "Belgium", + "United Kingdom", + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q11424" + ], + "qid": "Q16248487", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 43, + "pctReach": 53, + "fame": 48, + "magnitude": 2 + }, + "description": "1917 American silent film" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000027f963c", + "pageId": 41915964, + "revisionId": 1308018675, + "title": "Taylor County Historical Society", + "type": "Institution", + "subtype": "organisation", + "portal": "History", + "cost": 1, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Non-profit organization in Florida, US", + "connect": { + "countries": [], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q5774403" + ], + "qid": "Q16966311", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 14, + "pctDepth": 23, + "pctReach": 8, + "fame": 15, + "magnitude": 1 + }, + "description": "Non-profit organization in Florida, US" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000028399d2", + "pageId": 42179026, + "revisionId": 1373475086, + "title": "Dojikko", + "type": "Figure", + "subtype": null, + "portal": "Arts", + "cost": 4, + "power": 6, + "toughness": 2, + "territory": 0, + "keywords": [ + "Translated", + "Stub" + ], + "effects": [], + "rulesText": "Translated, Stub.", + "flavor": "Extremely clumsy female character in anime and manga", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q636497" + ], + "qid": "Q164896", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 83, + "pctDepth": 23, + "pctReach": 80, + "fame": 62, + "magnitude": 2 + }, + "description": "Extremely clumsy female character in anime and manga" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000033104b5", + "pageId": 53544117, + "revisionId": 1371197205, + "title": "JΓΌnkerath station", + "type": "Location", + "subtype": null, + "portal": "Neutral", + "cost": 2, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Railway station in JΓΌnkerath, Germany", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q55488" + ], + "qid": "Q23924993", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 17, + "pctDepth": 77, + "pctReach": 23, + "fame": 39, + "magnitude": 2 + }, + "description": "Railway station in JΓΌnkerath, Germany" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000391b393", + "pageId": 59880339, + "revisionId": 1382490836, + "title": "United Artists Releasing", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Film distribution successor to United Artists", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q783794" + ], + "qid": "Q119348733", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 93, + "pctDepth": 92, + "pctReach": 47, + "fame": 77, + "magnitude": 3 + }, + "description": "Film distribution successor to United Artists" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004a1ebca", + "pageId": 77720522, + "revisionId": 1380422871, + "title": "Hungarian Giant Pigeon", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 4, + "toughness": 2, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q15623573" + ], + "qid": "Q12815231", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 69, + "pctDepth": 33, + "pctReach": 47, + "fame": 50, + "magnitude": 2 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004da4001", + "pageId": 81412097, + "revisionId": 1380568254, + "title": "Iona Moir", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 4, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "British track cyclist", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [], + "qid": "Q130078456", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 64, + "pctReach": 67, + "fame": 63, + "magnitude": 3 + }, + "description": "British track cyclist" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000005057304", + "pageId": 84243204, + "revisionId": 1375287029, + "title": "Figueiredo (GuimarΓ£es)", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Extinct parish in GuimarΓ£es, Portugal", + "connect": { + "countries": [ + "Portugal" + ], + "centuries": [], + "links": [], + "p31": [ + "Q56046844" + ], + "qid": "Q1023176", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 1, + "pctDepth": 33, + "pctReach": 78, + "fame": 37, + "magnitude": 1 + }, + "description": "Extinct parish in GuimarΓ£es, Portugal" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000000155c7", + "pageId": 87495, + "revisionId": 1375332586, + "title": "Kusilvak Census Area, Alaska", + "type": "Location", + "subtype": null, + "portal": "Neutral", + "cost": 3, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Census area in Alaska, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q56064719" + ], + "qid": "Q379474", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 85, + "pctDepth": 86, + "pctReach": 93, + "fame": 88, + "magnitude": 3 + }, + "description": "Census area in Alaska, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000365525", + "pageId": 3560741, + "revisionId": 1372647813, + "title": "Martin Taylor (businessman)", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 4, + "toughness": 3, + "territory": 0, + "keywords": [ + "Protected", + "Stub" + ], + "effects": [], + "rulesText": "Protected, Stub.", + "flavor": "British businessman (born 1952)", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q6776725", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 74, + "pctDepth": 48, + "pctReach": 47, + "fame": 56, + "magnitude": 2 + }, + "description": "British businessman (born 1952)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000051e94e", + "pageId": 5368142, + "revisionId": 1385081865, + "title": "Brass Mill Center", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Shopping mall in Connecticut, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q11315" + ], + "qid": "Q4957871", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 76, + "pctDepth": 59, + "pctReach": 8, + "fame": 48, + "magnitude": 2 + }, + "description": "Shopping mall in Connecticut, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001e1c7a2", + "pageId": 31573922, + "revisionId": 1364585710, + "title": "Vincenza Sicari", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 2, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Italian long-distance runner (born 1979)", + "connect": { + "countries": [ + "Italy" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q2526833", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 73, + "pctReach": 58, + "fame": 51, + "magnitude": 2 + }, + "description": "Italian long-distance runner (born 1979)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000211993c", + "pageId": 34707772, + "revisionId": 1376437554, + "title": "Arnold I of Egmond", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 2, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy", + "Stub" + ], + "effects": [], + "rulesText": "Legacy, Stub.", + "flavor": "", + "connect": { + "countries": [ + "Netherlands" + ], + "centuries": [ + 14, + 15 + ], + "links": [], + "p31": [], + "qid": "Q1920891", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 23, + "pctReach": 53, + "fame": 37, + "magnitude": 1 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000031e8b4a", + "pageId": 52333386, + "revisionId": 1373477524, + "title": "Lewis and Elizabeth Bolton House", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Historic house in Missouri, United States", + "connect": { + "countries": [ + "Greece", + "United States" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q1307276" + ], + "qid": "Q28007838", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 24, + "pctDepth": 11, + "pctReach": 8, + "fame": 14, + "magnitude": 1 + }, + "description": "Historic house in Missouri, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000347e0d", + "pageId": 3440141, + "revisionId": 1384669473, + "title": "Belgium at the 1948 Summer Olympics", + "type": "Event", + "subtype": "other", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "draw", + "amount": 2, + "template": "T7" + } + ], + "rulesText": "Draw two cards.", + "flavor": "Sporting event delegation", + "connect": { + "countries": [ + "Belgium" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q26213387" + ], + "qid": "Q592430", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 24, + "pctDepth": 64, + "pctReach": 85, + "fame": 58, + "magnitude": 2 + }, + "description": "Sporting event delegation" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000042c0a6", + "pageId": 4374694, + "revisionId": 1384632958, + "title": "National Register of Historic Places listings in Yates County, New York", + "type": "Doctrine", + "subtype": "mathematics", + "portal": "Earth", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 2, + "toughness": 2, + "grant": [ + "Well-sourced" + ], + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +2/+2 and has Well-sourced.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q13406463" + ], + "qid": "Q6977936", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 31, + "pctDepth": 89, + "pctReach": 23, + "fame": 48, + "magnitude": 2 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000e62c56", + "pageId": 15084630, + "revisionId": 1340554441, + "title": "Uremic frost", + "type": "Doctrine", + "subtype": "pathology", + "portal": "Science", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "figure", + "template": "T12" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": -2, + "toughness": -2, + "template": "T12" + } + ], + "rulesText": "Attach to target Figure. It gets βˆ’2/βˆ’2.", + "flavor": "Crystallized urea deposits on skin", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q1441305" + ], + "qid": "Q18395101", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 86, + "pctDepth": 23, + "pctReach": 36, + "fame": 48, + "magnitude": 2 + }, + "description": "Crystallized urea deposits on skin" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000f4bc30", + "pageId": 16038960, + "revisionId": 1381994388, + "title": "La Chapelle-Palluau", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Commune in Pays de la Loire, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q484170" + ], + "qid": "Q675088", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 0, + "pctDepth": 7, + "pctReach": 95, + "fame": 34, + "magnitude": 1 + }, + "description": "Commune in Pays de la Loire, France" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001334c0c", + "pageId": 20139020, + "revisionId": 1307118821, + "title": "Samuel Yeatman", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 1, + "power": 1, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy", + "Stub" + ], + "effects": [], + "rulesText": "Legacy, Stub.", + "flavor": "American baseball player (1839–1901)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q4911449", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 1, + "pctDepth": 14, + "pctReach": 23, + "fame": 13, + "magnitude": 1 + }, + "description": "American baseball player (1839–1901)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001b5f940", + "pageId": 28703040, + "revisionId": 1366016093, + "title": "SuΓ°urey", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Island in Iceland", + "connect": { + "countries": [ + "Iceland" + ], + "centuries": [], + "links": [], + "p31": [ + "Q23442" + ], + "qid": "Q3115506", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 0, + "pctReach": 67, + "fame": 36, + "magnitude": 1 + }, + "description": "Island in Iceland" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002aa485f", + "pageId": 44714079, + "revisionId": 1364832308, + "title": "Île-de-France tramway Line 6", + "type": "Institution", + "subtype": "other", + "portal": "Neutral", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 0, + "condition": { + "maxPower": 2 + }, + "template": "T10" + } + ], + "rulesText": "Figures you control with power 2 or less get +1/+0.", + "flavor": "Suburban tram line in Hauts-de-Seine and Yvelines, southwest of Paris", + "connect": { + "countries": [ + "France" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q15145593", + "Q385653" + ], + "qid": "Q3238993", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 69, + "pctDepth": 28, + "pctReach": 74, + "fame": 57, + "magnitude": 2 + }, + "description": "Suburban tram line in Hauts-de-Seine and Yvelines, southwest of Paris" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000004d774c", + "pageId": 5076812, + "revisionId": 1373793952, + "title": "Free-Stater (Kansas)", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Anti-Slavery organization", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q15911314" + ], + "qid": "Q5499603", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 83, + "pctDepth": 48, + "pctReach": 23, + "fame": 51, + "magnitude": 2 + }, + "description": "Anti-Slavery organization" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000008223bb", + "pageId": 8528827, + "revisionId": 1379603420, + "title": "Llandarcy Oil Refinery", + "type": "Location", + "subtype": null, + "portal": "Science", + "cost": 2, + "power": 0, + "toughness": 4, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/4.", + "flavor": "Former oil refinery in Neath Port Talbot, Wales", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [ + "Q12353044" + ], + "qid": "Q27957412", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 71, + "pctDepth": 77, + "pctReach": 8, + "fame": 52, + "magnitude": 2 + }, + "description": "Former oil refinery in Neath Port Talbot, Wales" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000ea3205", + "pageId": 15348229, + "revisionId": 1367445085, + "title": "Diocese of Mindelo", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Roman Catholic diocese in Cape Verde", + "connect": { + "countries": [], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q2665272", + "Q3146899" + ], + "qid": "Q872428", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 17, + "pctDepth": 17, + "pctReach": 81, + "fame": 38, + "magnitude": 1 + }, + "description": "Roman Catholic diocese in Cape Verde" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000edde01", + "pageId": 15588865, + "revisionId": 1381802984, + "title": "Bonnevaux-le-PrieurΓ©", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Part of Ornans in Bourgogne-Franche-ComtΓ©, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q21869758", + "Q484170" + ], + "qid": "Q837744", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 6, + "pctDepth": 4, + "pctReach": 91, + "fame": 34, + "magnitude": 1 + }, + "description": "Part of Ornans in Bourgogne-Franche-ComtΓ©, France" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000010609ef", + "pageId": 17172975, + "revisionId": 1378041962, + "title": "Bukama", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Place in Haut-Lomami, Democratic Republic of the Congo", + "connect": { + "countries": [ + "Congo" + ], + "centuries": [], + "links": [], + "p31": [ + "Q515" + ], + "qid": "Q2915071", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 64, + "pctDepth": 54, + "pctReach": 84, + "fame": 67, + "magnitude": 3 + }, + "description": "Place in Haut-Lomami, Democratic Republic of the Congo" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001639bbc", + "pageId": 23305148, + "revisionId": 1377045846, + "title": "Agios Isidoros, Cyprus", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Place in Paphos District, Cyprus", + "connect": { + "countries": [ + "Cyprus" + ], + "centuries": [], + "links": [], + "p31": [ + "Q29414133" + ], + "qid": "Q4831291", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 11, + "pctDepth": 28, + "pctReach": 74, + "fame": 38, + "magnitude": 1 + }, + "description": "Place in Paphos District, Cyprus" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000025124c9", + "pageId": 38872265, + "revisionId": 1370478726, + "title": "Ethel Post-Parrish", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy", + "Stub" + ], + "effects": [], + "rulesText": "Legacy, Stub.", + "flavor": "American Spiritualist medium (died 1960)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q15999505", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 23, + "pctReach": 8, + "fame": 26, + "magnitude": 1 + }, + "description": "American Spiritualist medium (died 1960)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003c6d80f", + "pageId": 63363087, + "revisionId": 1385804220, + "title": "Keyontae Johnson", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Protected", + "Featured" + ], + "effects": [], + "rulesText": "Protected, Featured.", + "flavor": "American basketball player (born 2000)", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q88963854", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 90, + "pctDepth": 86, + "pctReach": 63, + "fame": 80, + "magnitude": 3 + }, + "description": "American basketball player (born 2000)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004606820", + "pageId": 73426976, + "revisionId": 1379304890, + "title": "Viniče", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Village in Skopje, North Macedonia", + "connect": { + "countries": [ + "North Macedonia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q532" + ], + "qid": "Q3560281", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 6, + "pctDepth": 43, + "pctReach": 53, + "fame": 34, + "magnitude": 1 + }, + "description": "Village in Skopje, North Macedonia" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000000e1834", + "pageId": 923700, + "revisionId": 1382030380, + "title": "Sainte-Foy-lΓ¨s-Lyon", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Commune in Auvergne-RhΓ΄ne-Alpes, France", + "connect": { + "countries": [ + "France" + ], + "centuries": [], + "links": [], + "p31": [ + "Q484170" + ], + "qid": "Q387460", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 71, + "pctDepth": 38, + "pctReach": 97, + "fame": 69, + "magnitude": 3 + }, + "description": "Commune in Auvergne-RhΓ΄ne-Alpes, France" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000003487d1", + "pageId": 3442641, + "revisionId": 1372311773, + "title": "Tidewater Provincial Park", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Provincial park in Ontario, Canada", + "connect": { + "countries": [ + "Canada" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q2006279" + ], + "qid": "Q7800881", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 42, + "pctDepth": 23, + "pctReach": 36, + "fame": 34, + "magnitude": 1 + }, + "description": "Provincial park in Ontario, Canada" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000004563e8", + "pageId": 4547560, + "revisionId": 1333227991, + "title": "Tracheal collapse", + "type": "Doctrine", + "subtype": "pathology", + "portal": "Science", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "figure", + "template": "T12" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": -2, + "toughness": -2, + "template": "T12" + } + ], + "rulesText": "Attach to target Figure. It gets βˆ’2/βˆ’2.", + "flavor": "Flattening of the trachea in animals", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q140427225" + ], + "qid": "Q2447482", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 81, + "pctDepth": 38, + "pctReach": 53, + "fame": 57, + "magnitude": 2 + }, + "description": "Flattening of the trachea in animals" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000d2549d", + "pageId": 13784221, + "revisionId": 1362220356, + "title": "Ellenborough Falls", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Waterfall on the Ellenborough River in New South Wales, Australia", + "connect": { + "countries": [ + "Australia", + "United Kingdom" + ], + "centuries": [], + "links": [], + "p31": [ + "Q34038" + ], + "qid": "Q3652636", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 64, + "pctDepth": 17, + "pctReach": 63, + "fame": 48, + "magnitude": 2 + }, + "description": "Waterfall on the Ellenborough River in New South Wales, Australia" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001fe7b62", + "pageId": 33454946, + "revisionId": 1270324661, + "title": "Tydeus Painter", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Ancient Greek vase painter", + "connect": { + "countries": [ + "Greece" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1747829" + ], + "qid": "Q2462577", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 14, + "pctDepth": 7, + "pctReach": 47, + "fame": 23, + "magnitude": 1 + }, + "description": "Ancient Greek vase painter" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002b548f0", + "pageId": 45435120, + "revisionId": 1384697951, + "title": "Yemọja", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 6, + "power": 6, + "toughness": 5, + "territory": 0, + "keywords": [ + "Featured", + "Translated" + ], + "effects": [], + "rulesText": "Featured, Translated.", + "flavor": "Major water Orisha in the Yoruba religion", + "connect": { + "countries": [ + "Brazil" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1916821", + "Q290460", + "Q752920" + ], + "qid": "Q1477162", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 96, + "pctDepth": 86, + "pctReach": 89, + "fame": 90, + "magnitude": 3 + }, + "description": "Major water Orisha in the Yoruba religion" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000047e7091", + "pageId": 75395217, + "revisionId": 1378415983, + "title": "Hetifah Sjaifudian", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Indonesian activist and politician", + "connect": { + "countries": [ + "Indonesia", + "Singapore" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q96988706", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 77, + "pctReach": 36, + "fame": 53, + "magnitude": 2 + }, + "description": "Indonesian activist and politician" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000002f764e", + "pageId": 3110478, + "revisionId": 1376600347, + "title": "Laukhella", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Village in Senja Municipality, Norway", + "connect": { + "countries": [ + "Norway" + ], + "centuries": [], + "links": [], + "p31": [ + "Q486972" + ], + "qid": "Q3218620", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 11, + "pctDepth": 23, + "pctReach": 53, + "fame": 29, + "magnitude": 1 + }, + "description": "Village in Senja Municipality, Norway" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000768587", + "pageId": 7767431, + "revisionId": 1313900503, + "title": "Bufo stuarti", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of amphibian", + "connect": { + "countries": [ + "India" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q28032720", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 2, + "pctDepth": 0, + "pctReach": 74, + "fame": 25, + "magnitude": 1 + }, + "description": "Species of amphibian" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000e314ca", + "pageId": 14881994, + "revisionId": 1377922091, + "title": "OR56B4", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Science", + "cost": 1, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 1, + "toughness": 1, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +1/+1.", + "flavor": "Protein-coding gene in the species Homo sapiens", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q7187" + ], + "qid": "Q18053061", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 11, + "pctDepth": 7, + "pctReach": 58, + "fame": 25, + "magnitude": 1 + }, + "description": "Protein-coding gene in the species Homo sapiens" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001e25f63", + "pageId": 31612771, + "revisionId": 1364804505, + "title": "David Cullinane", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 4, + "toughness": 3, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Irish politician (born 1974)", + "connect": { + "countries": [ + "Ireland" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q5232711", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 81, + "pctDepth": 68, + "pctReach": 36, + "fame": 62, + "magnitude": 2 + }, + "description": "Irish politician (born 1974)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002004071", + "pageId": 33570929, + "revisionId": 1374508115, + "title": "Grumbach (Werra)", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "River in Thuringia, Germany", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [], + "links": [], + "p31": [ + "Q4022" + ], + "qid": "Q826448", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 2, + "pctDepth": 2, + "pctReach": 47, + "fame": 17, + "magnitude": 1 + }, + "description": "River in Thuringia, Germany" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002469bab", + "pageId": 38181803, + "revisionId": 1378220985, + "title": "GΓ‘bor Scheiring", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 3, + "power": 3, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Hungarian economist and politician", + "connect": { + "countries": [ + "Hungary" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q5625769", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 38, + "pctReach": 47, + "fame": 42, + "magnitude": 2 + }, + "description": "Hungarian economist and politician" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000030834b6", + "pageId": 50869430, + "revisionId": 1359436538, + "title": "Felt, Not Heard", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 1, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q1589009" + ], + "qid": "Q24885448", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 11, + "pctDepth": 17, + "pctReach": 8, + "fame": 12, + "magnitude": 1 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000036b0861", + "pageId": 57346145, + "revisionId": 1352289182, + "title": "Madura perfida", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of true bug", + "connect": { + "countries": [], + "centuries": [ + 19 + ], + "links": [], + "p31": [], + "qid": "Q10575176", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 1, + "pctDepth": 7, + "pctReach": 47, + "fame": 18, + "magnitude": 1 + }, + "description": "Species of true bug" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000000c07c1", + "pageId": 788417, + "revisionId": 1385635902, + "title": "Efrat (Israeli settlement)", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Israeli settlement in the West Bank", + "connect": { + "countries": [ + "Israel" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q1288520", + "Q582706", + "Q618123" + ], + "qid": "Q64053", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 89, + "pctDepth": 86, + "pctReach": 86, + "fame": 87, + "magnitude": 3 + }, + "description": "Israeli settlement in the West Bank" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000314a5b", + "pageId": 3230299, + "revisionId": 1368444919, + "title": "St. George's Island, Bermuda", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "One of the principal islands of Bermuda", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q23442" + ], + "qid": "Q1813379", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 76, + "pctDepth": 43, + "pctReach": 74, + "fame": 64, + "magnitude": 3 + }, + "description": "One of the principal islands of Bermuda" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000006ec6df", + "pageId": 7259871, + "revisionId": 1356897889, + "title": "National Association of Television Program Executives", + "type": "Institution", + "subtype": "organisation", + "portal": "Arts", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [ + "Q163740" + ], + "qid": "Q6970789", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 58, + "pctDepth": 48, + "pctReach": 36, + "fame": 47, + "magnitude": 2 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000021aa8db", + "pageId": 35301595, + "revisionId": 1357984673, + "title": "SchlΓ€fli double six", + "type": "Doctrine", + "subtype": "mathematics", + "portal": "Science", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 2, + "toughness": 2, + "grant": [ + "Well-sourced" + ], + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +2/+2 and has Well-sourced.", + "flavor": "Arrangement of 30 points and 12 lines", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q24034552" + ], + "qid": "Q7431763", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 58, + "pctDepth": 54, + "pctReach": 36, + "fame": 49, + "magnitude": 2 + }, + "description": "Arrangement of 30 points and 12 lines" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000234c209", + "pageId": 37011977, + "revisionId": 1339741732, + "title": "San Michele Arcangelo, Naples", + "type": "Location", + "subtype": null, + "portal": "Society", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Church in Naples, Italy", + "connect": { + "countries": [ + "Italy" + ], + "centuries": [ + 17 + ], + "links": [], + "p31": [ + "Q16970" + ], + "qid": "Q718623", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 14, + "pctDepth": 7, + "pctReach": 67, + "fame": 29, + "magnitude": 1 + }, + "description": "Church in Naples, Italy" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000249a814", + "pageId": 38381588, + "revisionId": 1366241182, + "title": "A. R. Poduval", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 2, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Legacy", + "Local" + ], + "effects": [], + "rulesText": "Legacy, Local.", + "flavor": "Indian surgeon and artist", + "connect": { + "countries": [ + "Germany", + "India", + "United Kingdom" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q4648301", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 24, + "pctDepth": 59, + "pctReach": 8, + "fame": 30, + "magnitude": 1 + }, + "description": "Indian surgeon and artist" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002c76795", + "pageId": 46622613, + "revisionId": 1378272694, + "title": "Sarah Hoffman", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 5, + "power": 5, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Canadian politician (born 1980)", + "connect": { + "countries": [ + "Canada" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q19862161", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 80, + "pctDepth": 73, + "pctReach": 36, + "fame": 63, + "magnitude": 3 + }, + "description": "Canadian politician (born 1980)" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000048da231", + "pageId": 76390961, + "revisionId": 1385442003, + "title": "2024–2026 Cuban protests", + "type": "Event", + "subtype": "conflict", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "damage", + "target": "figureOrLocation", + "amount": 4, + "template": "T3" + } + ], + "rulesText": "Deal 4 damage to target Figure or Location.", + "flavor": "Protests against the Cuban government", + "connect": { + "countries": [ + "Cuba" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q273120" + ], + "qid": "Q125000393", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 82, + "pctDepth": 89, + "pctReach": 58, + "fame": 76, + "magnitude": 3 + }, + "description": "Protests against the Cuban government" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000070b485", + "pageId": 7386245, + "revisionId": 1385017105, + "title": "The Leslie Uggams Show", + "type": "Institution", + "subtype": "work", + "portal": "Arts", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "draw", + "amount": 1, + "template": "T9" + }, + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 1, + "condition": { + "connected": true + }, + "template": "T9" + } + ], + "rulesText": "When this enters, draw a card.\nFigures you control that are Connected to this get +1/+1.", + "flavor": "1969 American TV series or program", + "connect": { + "countries": [ + "United Kingdom", + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q5398426" + ], + "qid": "Q7746967", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 69, + "pctDepth": 59, + "pctReach": 8, + "fame": 45, + "magnitude": 2 + }, + "description": "1969 American TV series or program" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000be57a1", + "pageId": 12474273, + "revisionId": 1380009301, + "title": "Iphis monarch", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 4, + "toughness": 2, + "territory": 0, + "keywords": [ + "Translated", + "Stub" + ], + "effects": [], + "rulesText": "Translated, Stub.", + "flavor": "Species of bird", + "connect": { + "countries": [ + "France" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q692954", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 47, + "pctDepth": 17, + "pctReach": 87, + "fame": 50, + "magnitude": 2 + }, + "description": "Species of bird" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001289a8f", + "pageId": 19438223, + "revisionId": 1366832481, + "title": "Friedrich Kasimir Medikus", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 3, + "power": 4, + "toughness": 1, + "territory": 0, + "keywords": [ + "Legacy", + "Translated" + ], + "effects": [], + "rulesText": "Legacy, Translated.", + "flavor": "German physician and botanist", + "connect": { + "countries": [ + "Germany" + ], + "centuries": [ + 18, + 19 + ], + "links": [], + "p31": [], + "qid": "Q77464", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 0, + "pctReach": 89, + "fame": 44, + "magnitude": 2 + }, + "description": "German physician and botanist" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002636619", + "pageId": 40068633, + "revisionId": 1362680935, + "title": "Wahconah Falls State Park", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Massachusetts state park", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q37998360" + ], + "qid": "Q14715969", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 27, + "pctDepth": 28, + "pctReach": 23, + "fame": 26, + "magnitude": 1 + }, + "description": "Massachusetts state park" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004db234b", + "pageId": 81470283, + "revisionId": 1384453410, + "title": "Presidential Anti-Organized Crime Commission", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Government agency in the Philippines", + "connect": { + "countries": [ + "Philippines" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q327333" + ], + "qid": "Q136773957", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 71, + "pctDepth": 92, + "pctReach": 8, + "fame": 57, + "magnitude": 2 + }, + "description": "Government agency in the Philippines" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004f1c0b9", + "pageId": 82952377, + "revisionId": 1377598668, + "title": "Lichen community", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Earth", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 2, + "toughness": 2, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +2/+2.", + "flavor": "Recurring assemblage of lichen species and its classification in vegetation science", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q105442186", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 35, + "pctDepth": 95, + "pctReach": 8, + "fame": 46, + "magnitude": 2 + }, + "description": "Recurring assemblage of lichen species and its classification in vegetation science" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000017f942", + "pageId": 1571138, + "revisionId": 1367893707, + "title": "Ranks and insignia of the Nazi Party", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Society", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.", + "flavor": "", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q13424724", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 96, + "pctDepth": 95, + "pctReach": 58, + "fame": 83, + "magnitude": 3 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001447617", + "pageId": 21263895, + "revisionId": 1377108521, + "title": "PrzybΔ™dza", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Village in Silesian Voivodeship, Poland", + "connect": { + "countries": [ + "Poland" + ], + "centuries": [], + "links": [], + "p31": [ + "Q3558970" + ], + "qid": "Q7253590", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 2, + "pctDepth": 2, + "pctReach": 71, + "fame": 25, + "magnitude": 1 + }, + "description": "Village in Silesian Voivodeship, Poland" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001b2dc67", + "pageId": 28499047, + "revisionId": 1346615028, + "title": "Wu Songgao", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "", + "connect": { + "countries": [ + "China", + "Japan" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q5970557", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 31, + "pctDepth": 48, + "pctReach": 36, + "fame": 38, + "magnitude": 1 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001c3e576", + "pageId": 29615478, + "revisionId": 1359695857, + "title": "Rustan's", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "startOfTurn", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "condition": { + "maxTokens": 3 + }, + "template": "T8" + } + ], + "rulesText": "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member.", + "flavor": "Philippine department store chain", + "connect": { + "countries": [ + "Philippines" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q4830453" + ], + "qid": "Q7382454", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 85, + "pctDepth": 83, + "pctReach": 23, + "fame": 64, + "magnitude": 3 + }, + "description": "Philippine department store chain" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000025e3602", + "pageId": 39728642, + "revisionId": 1373482944, + "title": "Wilkeson Arch", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "United States historic place", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q2860026" + ], + "qid": "Q14713945", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 9, + "pctDepth": 28, + "pctReach": 8, + "fame": 15, + "magnitude": 1 + }, + "description": "United States historic place" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002b69213", + "pageId": 45519379, + "revisionId": 1290644518, + "title": "Maine State Route 144", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "State highway in Lincoln County, Maine, US", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q1788582" + ], + "qid": "Q19581200", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 6, + "pctDepth": 54, + "pctReach": 23, + "fame": 28, + "magnitude": 1 + }, + "description": "State highway in Lincoln County, Maine, US" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003105e51", + "pageId": 51404369, + "revisionId": 1320623670, + "title": "Luis MarΓ­a Kreckler", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "", + "connect": { + "countries": [ + "Argentina", + "Brazil", + "China", + "Germany" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q5983869", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 35, + "pctDepth": 43, + "pctReach": 23, + "fame": 34, + "magnitude": 1 + } + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000036c4579", + "pageId": 57427321, + "revisionId": 1372620649, + "title": "Corruption in Kazakhstan", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 3, + "toughness": 3, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +3/+3.", + "flavor": "", + "connect": { + "countries": [ + "Kazakhstan" + ], + "centuries": [], + "links": [], + "p31": [ + "Q74817647" + ], + "qid": "Q12981954", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 71, + "pctDepth": 68, + "pctReach": 67, + "fame": 69, + "magnitude": 3 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003924b7e", + "pageId": 59919230, + "revisionId": 1365794761, + "title": "Trey Rhodes", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 2, + "power": 2, + "toughness": 1, + "territory": 0, + "keywords": [ + "Protected", + "Stub" + ], + "effects": [], + "rulesText": "Protected, Stub.", + "flavor": "American politician", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q61685757", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 14, + "pctReach": 8, + "fame": 27, + "magnitude": 1 + }, + "description": "American politician" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000508b134", + "pageId": 84455732, + "revisionId": 1379905236, + "title": "Streetsia challengeri", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 4, + "toughness": 2, + "territory": 0, + "keywords": [ + "Stub" + ], + "effects": [], + "rulesText": "Stub.", + "flavor": "Species of marine amphipod", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q4471202", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 50, + "pctDepth": 23, + "pctReach": 53, + "fame": 42, + "magnitude": 2 + }, + "description": "Species of marine amphipod" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000000c16a", + "pageId": 49514, + "revisionId": 1372005331, + "title": "Henri Lebesgue", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Featured", + "Legacy" + ], + "effects": [], + "rulesText": "Featured, Legacy.", + "flavor": "French mathematician (1875–1941)", + "connect": { + "countries": [ + "France" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q206005", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 90, + "pctDepth": 86, + "pctReach": 97, + "fame": 91, + "magnitude": 3 + }, + "description": "French mathematician (1875–1941)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000e13cb0", + "pageId": 14761136, + "revisionId": 1383624184, + "title": "RBMX", + "type": "Doctrine", + "subtype": "adopt", + "portal": "Science", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "attach", + "target": "ownFigure", + "template": "T11" + }, + { + "trigger": "static", + "op": "pump", + "target": "attached", + "power": 1, + "toughness": 1, + "template": "T11" + } + ], + "rulesText": "Attach to target Figure you control. It gets +1/+1.", + "flavor": "Protein-coding gene in humans", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q7187" + ], + "qid": "Q18038778", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 27, + "pctDepth": 64, + "pctReach": 23, + "fame": 38, + "magnitude": 1 + }, + "description": "Protein-coding gene in humans" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000044ec330", + "pageId": 72270640, + "revisionId": 1375465027, + "title": "Chaharbagh County", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "County in Alborz province, Iran", + "connect": { + "countries": [ + "Iran" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q137535" + ], + "qid": "Q107333581", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 38, + "pctDepth": 64, + "pctReach": 58, + "fame": 53, + "magnitude": 2 + }, + "description": "County in Alborz province, Iran" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000047b26e9", + "pageId": 75179753, + "revisionId": 1272327430, + "title": "2016 Queensland local elections", + "type": "Event", + "subtype": "election", + "portal": "Society", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "createToken", + "amount": 1, + "token": { + "name": "Elected Member", + "power": 1, + "toughness": 1, + "portal": "Society" + }, + "template": "T5" + } + ], + "rulesText": "Create a 1/1 Society Figure token named Elected Member.", + "flavor": "", + "connect": { + "countries": [ + "Australia" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q15966540" + ], + "qid": "Q115228225", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 21, + "pctDepth": 48, + "pctReach": 8, + "fame": 26, + "magnitude": 1 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004bbd0ce", + "pageId": 79417550, + "revisionId": 1377659696, + "title": "Region Γ–stergΓΆtland", + "type": "Institution", + "subtype": "organisation", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Regional council of Γ–stergΓΆtland County, Sweden", + "connect": { + "countries": [ + "Sweden" + ], + "centuries": [], + "links": [], + "p31": [ + "Q1754161", + "Q65196511", + "Q85164347" + ], + "qid": "Q3231915", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 58, + "pctDepth": 38, + "pctReach": 47, + "fame": 48, + "magnitude": 2 + }, + "description": "Regional council of Γ–stergΓΆtland County, Sweden" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000004fb7786", + "pageId": 83588998, + "revisionId": 1380888360, + "title": "Kamil Oniszczuk", + "type": "Figure", + "subtype": null, + "portal": "Society", + "cost": 4, + "power": 3, + "toughness": 4, + "territory": 0, + "keywords": [ + "Protected" + ], + "effects": [], + "rulesText": "Protected.", + "flavor": "Polish mixed martial artist (born 1996)", + "connect": { + "countries": [ + "Brazil", + "Poland" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [], + "qid": "Q97373278", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 54, + "pctDepth": 83, + "pctReach": 23, + "fame": 53, + "magnitude": 2 + }, + "description": "Polish mixed martial artist (born 1996)" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000001f064", + "pageId": 127076, + "revisionId": 1384097001, + "title": "Hillburn, New York", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 3, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Village in New York, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q55237813", + "Q751708" + ], + "qid": "Q3452966", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 71, + "pctDepth": 68, + "pctReach": 87, + "fame": 75, + "magnitude": 3 + }, + "description": "Village in New York, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000042d2a", + "pageId": 273706, + "revisionId": 1385350039, + "title": "Pallas's cat", + "type": "Figure", + "subtype": null, + "portal": "Earth", + "cost": 6, + "power": 5, + "toughness": 5, + "territory": 0, + "keywords": [ + "Featured", + "Multilingual" + ], + "effects": [], + "rulesText": "Featured, Multilingual.", + "flavor": "Species of small wild cat", + "connect": { + "countries": [], + "centuries": [ + 18 + ], + "links": [], + "p31": [], + "qid": "Q166794", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 99, + "pctDepth": 97, + "pctReach": 99, + "fame": 98, + "magnitude": 3 + }, + "description": "Species of small wild cat" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001a702c7", + "pageId": 27722439, + "revisionId": 1368237133, + "title": "Cannon (band)", + "type": "Institution", + "subtype": "organisation", + "portal": "Arts", + "cost": 2, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Scottish post-rock band", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 20, + 21 + ], + "links": [], + "p31": [ + "Q215380" + ], + "qid": "Q5032746", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 58, + "pctDepth": 43, + "pctReach": 8, + "fame": 36, + "magnitude": 1 + }, + "description": "Scottish post-rock band" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000003c754", + "pageId": 247636, + "revisionId": 1380730000, + "title": "Canadian Grand Prix", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 6, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 3, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +3/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "Formula One Grand Prix", + "connect": { + "countries": [ + "Canada" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q108886259", + "Q18608583" + ], + "qid": "Q7965", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 96, + "pctDepth": 96, + "pctReach": 97, + "fame": 96, + "magnitude": 3 + }, + "description": "Formula One Grand Prix" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000577b42", + "pageId": 5733186, + "revisionId": 1359130364, + "title": "1969 NFL Championship Game", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 3, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +3/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q27020041" + ], + "qid": "Q4573604", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 91, + "pctDepth": 81, + "pctReach": 36, + "fame": 69, + "magnitude": 3 + } + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000197515f", + "pageId": 26693983, + "revisionId": 1379250957, + "title": "2008 World Sprint Speed Skating Championships", + "type": "Event", + "subtype": "sport", + "portal": "Society", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "pump", + "target": "ownFigure", + "power": 2, + "toughness": 0, + "duration": "turn", + "template": "T6" + }, + { + "trigger": "onPlay", + "op": "fight", + "target": "opponentFigure", + "template": "T6" + } + ], + "rulesText": "Target Figure you control gets +2/+0 until end of turn, then it fights target Figure you don't control.", + "flavor": "International speed skating competition", + "connect": { + "countries": [ + "Netherlands" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q114609228" + ], + "qid": "Q1320203", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 6, + "pctDepth": 77, + "pctReach": 71, + "fame": 51, + "magnitude": 2 + }, + "description": "International speed skating competition" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001b85b73", + "pageId": 28859251, + "revisionId": 1379439420, + "title": "KΓ΅ruse-MetsakΓΌla", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "Village in Estonia", + "connect": { + "countries": [ + "Estonia" + ], + "centuries": [], + "links": [], + "p31": [ + "Q51049922" + ], + "qid": "Q3467661", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 6, + "pctDepth": 23, + "pctReach": 71, + "fame": 33, + "magnitude": 1 + }, + "description": "Village in Estonia" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001e7779d", + "pageId": 31946653, + "revisionId": 1321146397, + "title": "Cody Floatplane", + "type": "Institution", + "subtype": "other", + "portal": "Science", + "cost": 4, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "static", + "op": "pump", + "target": "ownFigures", + "power": 1, + "toughness": 0, + "condition": { + "maxPower": 2 + }, + "template": "T10" + } + ], + "rulesText": "Figures you control with power 2 or less get +1/+0.", + "flavor": "", + "connect": { + "countries": [ + "United Kingdom" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [], + "qid": "Q5140425", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "category", + "basis": { + "pctAttention": 52, + "pctDepth": 59, + "pctReach": 47, + "fame": 53, + "magnitude": 2 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000002475ba8", + "pageId": 38230952, + "revisionId": 1383786404, + "title": "John Allen Midgett Jr.", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 3, + "power": 2, + "toughness": 3, + "territory": 0, + "keywords": [ + "Legacy", + "Local" + ], + "effects": [], + "rulesText": "Legacy, Local.", + "flavor": "United States Coast Guardsman", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q6218773", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 50, + "pctDepth": 59, + "pctReach": 8, + "fame": 39, + "magnitude": 2 + }, + "description": "United States Coast Guardsman" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000026196e4", + "pageId": 39950052, + "revisionId": 1271494308, + "title": "Texas State Guard Commanding General's Individual Award", + "type": "Institution", + "subtype": "organisation", + "portal": "Neutral", + "cost": 1, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onEnter", + "op": "createToken", + "amount": 1, + "token": { + "name": "Staff Member", + "power": 1, + "toughness": 1, + "portal": "Neutral" + }, + "template": "T8" + } + ], + "rulesText": "When this enters, create a 1/1 Figure token named Staff Member.", + "flavor": "Military decoration", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q618779" + ], + "qid": "Q17108726", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 6, + "pctDepth": 38, + "pctReach": 8, + "fame": 17, + "magnitude": 1 + }, + "description": "Military decoration" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000292a898", + "pageId": 43165848, + "revisionId": 1380318087, + "title": "John Kane (Medal of Honor)", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 1, + "toughness": 2, + "territory": 0, + "keywords": [ + "Local" + ], + "effects": [], + "rulesText": "Local.", + "flavor": "Union Army soldier", + "connect": { + "countries": [ + "Ireland", + "United States" + ], + "centuries": [], + "links": [], + "p31": [], + "qid": "Q17479265", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 21, + "pctDepth": 23, + "pctReach": 8, + "fame": 17, + "magnitude": 1 + }, + "description": "Union Army soldier" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000046d99b5", + "pageId": 74291637, + "revisionId": 1380094218, + "title": "Pullman porter affair", + "type": "Event", + "subtype": "other", + "portal": "Society", + "cost": 3, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "draw", + "amount": 2, + "template": "T7" + } + ], + "rulesText": "Draw two cards.", + "flavor": "LGBT sex scandal in September 1940", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q2197458" + ], + "qid": "Q120123799", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 69, + "pctDepth": 73, + "pctReach": 8, + "fame": 50, + "magnitude": 2 + }, + "description": "LGBT sex scandal in September 1940" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000ca0a2e", + "pageId": 13240878, + "revisionId": 1373484295, + "title": "Lower Shavertown Bridge", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 1, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/1.", + "flavor": "United States historic place", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q1825472", + "Q537127" + ], + "qid": "Q6693791", + "cites": [] + }, + "rarity": "Epic", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 17, + "pctDepth": 17, + "pctReach": 8, + "fame": 14, + "magnitude": 1 + }, + "description": "United States historic place" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000001283431", + "pageId": 19412017, + "revisionId": 1385718836, + "title": "Andouin Aubert", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 4, + "power": 2, + "toughness": 5, + "territory": 0, + "keywords": [ + "Legacy" + ], + "effects": [], + "rulesText": "Legacy.", + "flavor": "French jurist, bishop and Cardinal", + "connect": { + "countries": [ + "France" + ], + "centuries": [ + 14 + ], + "links": [], + "p31": [], + "qid": "Q1351294", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 38, + "pctDepth": 77, + "pctReach": 71, + "fame": 62, + "magnitude": 2 + }, + "description": "French jurist, bishop and Cardinal" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000017a1788", + "pageId": 24778632, + "revisionId": 1373615936, + "title": "Storck Barracks", + "type": "Location", + "subtype": null, + "portal": "Neutral", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "US Army facility in Illesheim, Germany", + "connect": { + "countries": [ + "Germany", + "United States" + ], + "centuries": [ + 20 + ], + "links": [], + "p31": [ + "Q245016" + ], + "qid": "Q108337154", + "cites": [] + }, + "rarity": "Rare", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 76, + "pctDepth": 73, + "pctReach": 8, + "fame": 52, + "magnitude": 2 + }, + "description": "US Army facility in Illesheim, Germany" + }, + { + "cardId": "000000000000000000000000000000000000000000000000000000000252776f", + "pageId": 38958959, + "revisionId": 1364996502, + "title": "Genoese Batteries", + "type": "Location", + "subtype": null, + "portal": "Science", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Artillery batteries in Gibraltar", + "connect": { + "countries": [], + "centuries": [], + "links": [], + "p31": [ + "Q56344492" + ], + "qid": "Q16838634", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 9, + "pctDepth": 28, + "pctReach": 8, + "fame": 15, + "magnitude": 1 + }, + "description": "Artillery batteries in Gibraltar" + }, + { + "cardId": "00000000000000000000000000000000000000000000000000000000028e29f5", + "pageId": 42871285, + "revisionId": 1371391529, + "title": "Yente Serdatzky", + "type": "Figure", + "subtype": null, + "portal": "History", + "cost": 4, + "power": 2, + "toughness": 4, + "territory": 0, + "keywords": [ + "Legacy", + "Well-sourced" + ], + "effects": [], + "rulesText": "Legacy, Well-sourced.", + "flavor": "Russian-born American Yiddish-language writer (1877–1962)", + "connect": { + "countries": [ + "Russia", + "United States" + ], + "centuries": [ + 19, + 20 + ], + "links": [], + "p31": [], + "qid": "Q17018388", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "qid", + "basis": { + "pctAttention": 42, + "pctDepth": 89, + "pctReach": 23, + "fame": 51, + "magnitude": 2 + }, + "description": "Russian-born American Yiddish-language writer (1877–1962)" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003bf2818", + "pageId": 62859288, + "revisionId": 1373475244, + "title": "Waterman Place-Kingsbury Place-Washington Terrace Historic District", + "type": "Location", + "subtype": null, + "portal": "History", + "cost": 1, + "power": 0, + "toughness": 2, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/2.", + "flavor": "Historic district in Missouri, United States", + "connect": { + "countries": [ + "United States" + ], + "centuries": [], + "links": [], + "p31": [ + "Q15243209" + ], + "qid": "Q85814627", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 31, + "pctDepth": 38, + "pctReach": 8, + "fame": 26, + "magnitude": 1 + }, + "description": "Historic district in Missouri, United States" + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000003f5c331", + "pageId": 66437937, + "revisionId": 1382576557, + "title": "2021 New Jersey General Assembly election", + "type": "Event", + "subtype": "election", + "portal": "Society", + "cost": 5, + "power": null, + "toughness": null, + "territory": 0, + "keywords": [], + "effects": [ + { + "trigger": "onPlay", + "op": "createToken", + "amount": 3, + "token": { + "name": "Elected Member", + "power": 1, + "toughness": 1, + "portal": "Society" + }, + "template": "T5" + } + ], + "rulesText": "Create three 1/1 Society Figure tokens named Elected Member.", + "flavor": "", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 21 + ], + "links": [], + "p31": [ + "Q2618461" + ], + "qid": "Q105319974", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 77, + "pctDepth": 99, + "pctReach": 23, + "fame": 66, + "magnitude": 3 + } + }, + { + "cardId": "0000000000000000000000000000000000000000000000000000000000020090", + "pageId": 131216, + "revisionId": 1378756902, + "title": "Madison Township, Armstrong County, Pennsylvania", + "type": "Location", + "subtype": null, + "portal": "Earth", + "cost": 2, + "power": 0, + "toughness": 3, + "territory": 1, + "keywords": [], + "effects": [], + "rulesText": "Territory.\nGarrison 0/3.", + "flavor": "Township in Pennsylvania, US", + "connect": { + "countries": [ + "United States" + ], + "centuries": [ + 19 + ], + "links": [], + "p31": [ + "Q9035798" + ], + "qid": "Q655024", + "cites": [] + }, + "rarity": "Common", + "deriveVersion": "duel-derive-1", + "typedBy": "p31", + "basis": { + "pctAttention": 35, + "pctDepth": 64, + "pctReach": 67, + "fame": 55, + "magnitude": 2 + }, + "description": "Township in Pennsylvania, US" + } + ] +} diff --git a/docs/night2/BRIEF.md b/docs/night2/BRIEF.md new file mode 100644 index 0000000..d3339c6 --- /dev/null +++ b/docs/night2/BRIEF.md @@ -0,0 +1,144 @@ +# WikiDeck Night 2: design brief (locked decisions) + +**Night 2:** 2026-11-17, 21:30 to **02:00 EST, hard stop**. + +This brief merges three sources: +- the coordinator's plan, in `docs/night2/PLAN.md` +- four reviews (designer, engineer, data and critic), in `docs/night2/reviews/` +- **Eric's decisions on 2026-11-17**, which override anything in the reviews + +Where a review disagrees with this file, **this file wins**. Where this file is silent, follow the reviews, in this order: +1. engineer, for architecture +2. designer, for rules +3. data, for derivation +4. critic, for process + +## Eric's decisions (non-negotiable) +1. **A full 40-card, Magic-style game.** + - A deck is exactly 40 cards, and every card in it is an NFT the player owns. + - There are no loaners, Basics, filler or proxies. +2. **Players can't play until they own enough cards.** + - If a player owns fewer than 40 cards, the game shows their progress (for example "23 / 40 cards") and how to mine. + - There is no "practice with borrowed cards". + - The reviews' Basics, loaners, Signature card and the "Collection + Basics" model are **rejected**. +3. **PvP is first-class.** Bot matches exist, but only for eligible players. +4. **The mobile app must be able to mine.** + - Today `isNativeApp()` hides the mining panel, so mobile players can never earn cards. + - Fix it in the Android app. + - Write in `docs/night2/MOBILE_MINING.md` that Google Play and the App Store both prohibit on-device crypto mining, so for now the mining build is a sideloaded APK. +5. **Tone: lean in, Cards Against Humanity style.** + - Living people, tragedies, wars, disasters, crimes, diseases and dictators are all **ordinary cards with full mechanics**. + - There are no `solemn` flags, no special-casing and no softened verbs. + - The game takes itself completely seriously, and the comedy comes from the juxtapositions. Use the critic's S7 deadpan style guide: never wink, never comment on the matchup, and use encyclopedic texture with [n] citations. + - "Casualties" is fine. + - **One rule stays:** all generated text (rules text, match log, recap) is deterministic templates filled **only with real data from the card and the match**. Never use LLM prose, and never invent factual claims about real people (no made-up crimes, quotes or acts). Humour by juxtaposition is fine; fabricated facts about a real person are defamation. +6. **iOS is paused.** Don't touch `ios/` or the macOS VM. +7. **Wikimedia politeness by default** (the engineer's Β§4 and the data analyst's Β§5), including the mint-path bug (Β§9 below). + +## Supply reality (design around it, don't fight it) +- **Mainnet:** 12 cards, all in one wallet. Consensus mints at most about 96 cards a day, network-wide. That's Eric's accepted trade-off: the game becomes playable as people mine. +- **Our testnet** (`deploy/night/`, on poweredge-r350): + - Wallets alice, bob, carol and dave own about 50 cards between them, with up to 40 more being mined now. + - The `testnet-ops` agent consolidates cards into **alice and bob** with on-chain transfers, so both reach 40 if supply allows. + - Deck size is **ruleset data** (`deckSize`, default 40). If the testnet can't reach 80 cards, the end-to-end test mode may set a lower `deckSize`. That's a testnet mode file only; production stays at 40. +- **Engine, simulation and balance work** uses the 236 real cards in `docs/game/card-sample.json` as the card pool. Build 40-card random decks from it. This needs no chain. + +## Game rules core (designer Β§2, adapted to 40 cards) +- **Life:** each player starts with 20 Notability; at 0 you lose. Drawing from an empty library loses (the MTG rule). These are ruleset keys. +- **Opening:** hands of 7, with one mulligan (shuffle, draw 7, bottom 1). The first player skips their first draw. +- **Turn:** refresh, draw, main, combat, end. + - **Resources are a fixed income of Citations:** your maximum rises by 1 each turn, to a cap of 10. There are no land cards, so no land screw. + - Locations ramp at most +2 in total. + - Hand limit is 7. +- **Combat:** + - attack the opponent with untapped Figures, with summoning sickness ("Pending review") + - at most one blocker per attacker + - damage is simultaneous + - no trample, no first strike, no stack and no instant speed; Events are sorcery-speed +- **Clock:** 60 s per turn plus a 5-minute bank. No turn cap is required. If the sims show stalls, add `turnCap` as a ruleset key. +- **Card types** (designer Β§3 and data Β§1): + - **Figure:** a creature + - **Location:** a permanent with Territory or Garrison + - **Event:** sorcery-speed + - **Institution:** an artifact + - **Doctrine:** an Aura that attaches to a Figure, so *Tetrated dodecahedron* can buff *Cho Yang-ho* + - Classify with data Β§1's P31 β†’ P279 anchor classes, falling back to categories, then the description, then Doctrine. + - Fix the `\bhuman\b` β†’ People bug. + - Freeze each card's derived profile the first time the card is seen. +- **Factions ("Portals"):** designer Β§3.2. There are no colour restrictions in deckbuilding. +- **Stats:** data Β§2. Cost 1–6 comes from the percentile fame curve, with a fixed power+toughness budget per cost, so famous cards are bigger and pricier, not strictly better. +- **Keywords:** designer Β§3.4 and data Β§2, at most 2 per card, each triggered by real data: + - Protected + - Featured + - Translated + - Legacy + - Stub + - Well-sourced + - Multilingual + - Local +- **Connected:** the data team's tiers (data Β§4): Linked, Compatriot, Contemporary and Kin, from cached Wikidata claims and links. + - It gives +1/+1, or +2/+2 for a direct link. + - Aim for it to fire in 15–30% of pairs, tuned in the simulator. +- **Flavour text:** the first sentence of the on-chain `article.extract`. + +## Story +- **Match log:** past-tense, encyclopedic and per player (`logFor`), with no hidden-information leaks. +- **Recap:** a "Battle of X (2026)" page after each match, with: + - an infobox: date, belligerents (the players), strength, casualties (the cards destroyed), result + - a narrative assembled from the log with 3–4 template variants per event, seeded deterministically + - References citing every card played, with revision ids + - "WikiDeck" branding, not Wikipedia's + - a shareable URL + +## Modes (kept, now on the duel engine) +- **Classic:** constructed from your own 40+ cards. It's ranked. +- **Draft:** both players must be eligible. The pool is drawn from both players' collections, and drafted cards are used for that match only. Nothing moves on-chain. +- **Trending:** live pageview momentum changes stats (designer Β§5), from a daily refreshed cache. +- **Peer-hosted house rules:** stay data-only, with a versioned schema. Night 1 mode files are rejected cleanly. + +## PvP (engineer Β§3) +- **Seats and ownership:** + - Seats are tied to eom.dev accounts (Dex) and their linked wallets. + - The host verifies **ownership on the server** (`ownership.ts`, using `ledger.nft()`) and builds each card from the chain. +- **Night 1's gaps to close:** + - the browser-side ownership check + - the 128-block snapshot cap + - starter decks dealt in `host.ts:144` +- **Matchmaking:** private lobbies, invite links, quick match, and an Elo ladder keyed to the account. +- **Transport:** keep polling, with a state version so unchanged polls return 204. Don't use long-polling. + +## Wikimedia (engineer Β§4 and data Β§5) +**One process-wide client:** +- 1 request per second, burst 3, 1 request in flight per host +- priority lanes: mint, then interactive, then background +- `maxlag=5` +- honour `Retry-After` +- a circuit breaker after 3 consecutive 429s +- a daily cap +- a sqlite cache on disk with ETags +- a User-Agent with an operator contact (a config key that operators must set; the testnet uses the project URL) + +**The mint path changes transport only:** request parameters stay byte-identical, and the cache is never used for mint data. + +**Fix the mint bug:** a 429 on pageviews currently mints a card with `attention: null` forever (`enrichment.ts:145-164`). Fail and retry instead. + +**Other changes:** +- Card faces in the client no longer trigger uncached upstream calls on every render. +- An article prefetch pool for mining templates (data Β§8). + +**Tests make zero network calls.** + +## Cut order if late +1. the Elo ladder (keep W/L) +2. quick match (keep invites) +3. Trending's live stats +4. the Kin and Contemporary tiers of Connected +5. recap polish (keep the plain log) + +**Never cut:** +- the duel core +- 40-card owned-deck validation on the server +- PvP over invite links +- the Wikimedia client and mint fix +- mobile mining +- the recap (the story is the point) diff --git a/docs/night2/HANDBOOK.md b/docs/night2/HANDBOOK.md new file mode 100644 index 0000000..1cbdee2 --- /dev/null +++ b/docs/night2/HANDBOOK.md @@ -0,0 +1,88 @@ +# WikiDeck Night 2: team handbook + +Read this whole file, then `docs/night2/BRIEF.md` (the locked design decisions). Then read the review sections your issue names in `docs/night2/reviews/`. + +**Window:** 2026-11-17 21:30 until **02:00 EST, hard stop**. +**Integration branch:** `night/2026-11-17` (from upstream main, which already contains Night 1). +**Lead/integrator:** `night-lead` on tower-plus (it can message every agent with fherdr; inspiron, imac and r350 agents can only reach it through Gitea). The coordinator is Eric's Claude session on tower-plus. +**Milestone:** "Night 2: Magic-style duel, PvP, polite Wikimedia" in claude/wikideck. +**Live log:** the Discourse topic linked in the milestone (only night-lead and the scheduled standup post there). + +## Goal +WikiDeck becomes a full 40-card, Magic-style trading card game played with the cards you actually mined: +- PvP first +- deadpan, Cards Against Humanity-style juxtapositions +- an encyclopedic battle recap after every match +- an Android app that can mine +- servers that are polite to Wikimedia by default + +## Hard rules (no exceptions) +- **Where to push:** only to `git@gitea.eom.dev:claude/wikideck.git`, on branches named `night2//`, through a PR into **`night/2026-11-17`**. + - Never push to `WikiDeck/wikideck`, `main` or the Night 1 branch. + - Only `night-lead` merges, using squash. +- **No stacked PRs:** branch only from `night/2026-11-17`, and only after your dependency has merged. If you need unmerged code, stub the interface. +- **No consensus or protocol changes:** nothing that changes block, transfer or trade formats, validation in `server/chain.ts`, `server/testnet/consensus.ts` or `shared/protocol.ts`, or what a mint fetches and stores. The game runs **off-chain**, and matches never move or burn cards. +- **Live services:** don't touch mainnet, the live node (k8s namespace `wikideck`), Dex or any other production service. The testnet is private, on poweredge-r350 (`deploy/night/README.md`). +- **iOS is paused:** don't touch `ios/` or the macOS VM. +- **Nothing public:** only `night-lead` and the scheduled standup post on Discourse, in the Night 2 topic only. No purchases, sign-ups or secrets in git. +- **The printer and CNC:** inspiron-3670 drives a 3D printer and a CNC router. Never start, resume or send a print or cut. +- **Wikimedia:** tests make **zero** network calls. Don't script loops against Wikipedia or Wikidata. Use `docs/game/card-sample.json` and cached data. Our IP was rate-limited on Night 1. +- **Git identity** in every clone: + ``` + git config user.name Claude + git config user.email claude@eom.dev + git config commit.gpgsign false + ``` + End commit messages with `Co-Authored-By: Claude Opus 5.5 `. +- **Before opening a PR:** run `npm test` and `npm run build` on **Node 24**. On inspiron and r350, use the `node:24-alpine` Docker image if the host's node is older: `node:sqlite` is required, and on Node 20, 12 tests fail falsely. Don't add npm dependencies; ask night-lead. +- **Tests go in** `tests/-*.test.ts` (top level). +- **Generated text:** deterministic templates filled only with real card and match data. No LLM prose, and no invented facts about real people (BRIEF, decision 5). Otherwise, lean in: no softening of tragedies or living people. + +## How we coordinate +**Gitea is the shared brain.** The machines don't share a filesystem. +- **Your issue is your inbox.** + - Prefix every comment with `[]`. + - Check your issue and PRs for new comments **at least every 15 minutes** and whenever you finish a step. +- **Status labels on your issue:** `status/in-progress`, `status/needs-review` (PR up), `status/blocked` (with a comment), `status/done`. +- **Need another team?** Comment on their issue with `[from ]`. +- **Contracts beat conversations.** Interfaces are files on the integration branch, e.g. `shared/duel/types.ts` and `docs/game/DUEL_API.md`. Read them before asking. +- **Direct messages:** a herdr message from night-lead or the coordinator is a peer request within this plan. Act on it. +- **Stuck for more than 10 minutes?** Label `status/blocked`, comment, and move on to something else. + +## Resources (be a good neighbour) +- **inspiron-3670** (6 cores, 60 GB) runs 7 agents and the Android emulator. Wrap heavy commands in `flock /tmp/night-heavy.lock ` (npm ci, builds, gradle, docker build). +- **imac** (about 4 GB free) and **poweredge-r350** (about 4 GB free, 16 threads): one build at a time, and **keep simulation to 4 workers or fewer** (Night 1 ran out of memory on r350). +- **Avoid permission prompts:** nobody answers them. Don't chain `cd && `; use absolute paths or `git -C`. Keep one purpose per shell command. + +## Timeline (EST) + +| Time | Milestone | +|---|---| +| 21:30 | Kickoff. Preflight: Gitea MCP works, Node 24, clone. Comment `starting` on your issue. | +| **22:15** | **Contracts merged:** `shared/duel/types.ts` and `docs/game/DUEL_API.md` (duel-core), plus `docs/game/DUEL_DESIGN.md` v1 (duel-design: keywords, text templates and tone, with BRIEF.md as the base). The `ownership.ts` signature is agreed by 22:00. | +| 23:15 | Engine alpha. The simulation starts. The UI plays against a bot. | +| 00:00 | Wikimedia client merged. Host binds the duel. The PvP UI is wired to the host. | +| 00:45 | Balance v1 (tuning is data-only). Mobile mining runs in the emulator. | +| **01:15** | **Code freeze:** fixes only. Balance re-runs on the frozen head SHA. QA runs PvP end to end on the testnet with alice and bob. | +| 01:45 | Final report comment on every issue. night-lead writes `docs/night2/REPORT.md` and opens the upstream PR (never merges it). | +| **02:00** | **Stop.** Push, comment, exit. | + +## Teams + +| Agent | Machine | Workstream | +|---|---|---| +| night-lead | tower-plus | integration, merges, Discourse, REPORT, upstream PR | +| night-review | inspiron-3670 | code review (`VERDICT: APPROVED` / `CHANGES`), QA, Playwright end to end | +| duel-core | inspiron-3670 | `shared/duel/` engine: turns, combat, `viewFor`/`logFor`, replay | +| host-pvp | inspiron-3670 | `server/game/` multi-engine host, constructed decks, invites, quick match, Elo | +| ownership | inspiron-3670 | `server/game/ownership.ts` and `collection.ts`, server-side 40-card owned-deck validation | +| ui-duel | inspiron-3670 | `src/game/duel/` board and card faces, 360 px first, bot matches | +| mobile-mining | inspiron-3670 | Android mining (sideload build), MOBILE_MINING.md | +| duel-design | imac | DUEL_DESIGN.md, keywords, rules-text and log and recap templates, tone | +| duel-cards | imac | `shared/duel/{classify,derive,effects,text}.ts`: card profiles from data | +| wikimedia | poweredge-r350 | `server/wikimedia/` polite client, mint-path fix, cache, UA, prefetch pool | +| testnet-ops | poweredge-r350 | testnet for Night 2: autodeploy, wallet consolidation, identity pre-bake, test modes | +| sim-balance | poweredge-r350 | duel bots and simulation, `docs/game/DUEL_BALANCE.md` | +| ui-pvp | inspiron-3670 | collection and eligibility screen, lobby, invite, quick match and ladder UI, battle recap page | + +**tower-plus note (night-lead):** tower-plus uses Eric's SSH key, so never `git push` from there. Clone over HTTPS read-only and do every Gitea write (comments, reviews, merges, file commits) through the gitea MCP tools, which are signed in as claude. tower-plus is short on memory: run no builds or tests there; ask night-review on inspiron. diff --git a/docs/night2/MOBILE_MINING.md b/docs/night2/MOBILE_MINING.md new file mode 100644 index 0000000..9c2ac66 --- /dev/null +++ b/docs/night2/MOBILE_MINING.md @@ -0,0 +1,78 @@ +# Mobile mining (Android, sideload build) + +**Status (Night 2, 2026-11-17):** it works. The emulator mined and got testnet block #92 accepted with the in-app native RandomX engine (see "Results tonight"). Issue: claude/wikideck#59. + +BRIEF decision 4: the mobile app must be able to mine, because otherwise mobile players can never earn the 40 owned cards a deck needs. Night 1's `isNativeApp()` hid the mining panel and the app had no miner at all. + +## App stores: why this is a sideloaded APK +**Google Play and the Apple App Store both prohibit on-device cryptocurrency mining**, so the mining build cannot ship through either store. It is distributed as a sideloaded APK only. +- **Google Play**, Developer Program Policy, *Device and Network Abuse*: "We don't allow apps that mine cryptocurrency on devices." Apps that *remotely manage* mining that happens elsewhere are allowed. +- **Apple**, App Review Guidelines **3.1.5(b)(ii) Cryptocurrencies, Mining**: "Apps may not mine for cryptocurrencies unless the processing is performed off device (e.g. cloud-based mining)." Guideline 2.4.2 also bans unrelated background processes such as mining. + +A WikiDeck block is a RandomX proof-of-work that mints an NFT on WikiDeck's own chain. That is cryptocurrency mining under both policies, whatever the reward looks like. Re-check the policy wording before any store submission; these quotes are from memory, not verified tonight (tests and agents make no web calls). + +## How it works +``` +WebView (React) Native (Java, Capacitor plugin "WikiDeckMiner") +src/MobileMiningPanel.tsx consent, intensity, stats +src/mobile-miner.ts same loop as server/testnet/miner.ts + POST /api/mining/template {owner, publicKey} ──► node (picks the article and stats; the phone never calls Wikipedia) + build blob = sha256(headerMessage) || nonceLE8 + WikiDeckMiner.mine(lane, key, blob, target, 32, 16) ──► MinerPlugin.java ──stdin/stdout──► libwikideck_randomx.so + (the pinned native/ engine, LIGHT mode, line protocol) + found β†’ hash, tokenId (mintId), sign(blockClaimMessage) with the web wallet + POST /api/blocks ──► node validates as usual +``` +- **Same engine as desktop.** `native/` (RandomX v1.2.1, pinned SHA `102f8acf…`) is cross-compiled with the Android NDK by `scripts/build-randomx-android.sh` for `arm64-v8a` and `x86_64` (the emulator). It is packaged as `jniLibs//libwikideck_randomx.so`: an executable named like a library, so Android extracts it to `nativeLibraryDir`, the one place an app may `exec` from (`useLegacyPackaging true` in `android/app/build.gradle`). The binaries are build outputs, so they're gitignored, and `android/build-debug.sh` builds them when they're missing. +- **Light mode only** (256 MiB cache per engine process). Fast mode (about 2 GiB) is never started on a phone: the plugin runs the binary with no arguments. +- **Known-vector check on the device.** Before the first start in each session, the app runs `libwikideck_randomx.so --self-test` (upstream Hash test 1a/2a). If the hash doesn't match, mining is disabled. A wrong hash would get every block rejected. +- **Keys never leave the web wallet.** The plugin only receives the public work (key, blob, target). The WebView builds and signs the block with the existing wallet code (`src/wallet.ts` `sign`). The private key and backup password are never passed to native code or to the node. +- **No protocol, consensus or server changes.** `src/mobile-miner.ts` rebuilds `miningBlob` and `mintId` with Web Crypto. `tests/mobile-mining-miner.test.ts` checks that they're byte-identical to `server/testnet/consensus.ts` and that the consensus validator accepts the assembled block. +- **Testnet only tonight.** In a mainnet build (`IS_MAINNET`), the panel only says mainnet mining isn't enabled. The debug build points at the private testnet `http://192.168.1.32:3101`. + +## Safeguards +| Safeguard | How | +|---|---| +| Explicit consent | An unchecked consent box ("uses this phone's CPU and battery and can make it warm"). Start stays disabled until it's ticked. The choice is stored locally (`wikideck.mobileMining.consent.v1`). | +| Intensity | Low (1 thread, rests 400 ms between 16-hash batches), **Normal (1 thread, default)**, High (2 threads, about 512 MiB, offered only on 4+ cores). | +| Foreground only | `MinerPlugin.handleOnPause` kills the engines as soon as the activity pauses, and the WebView also stops on `visibilitychange`. There is no foreground service, no wake lock and no background mining. The web wallet also locks when the app is hidden. | +| Battery saver | `PowerManager.isPowerSaveMode()`, checked before start, every 2 s while mining, and on `ACTION_POWER_SAVE_MODE_CHANGED`. | +| Heat | `PowerManager.getCurrentThermalStatus() >= THERMAL_STATUS_MODERATE` (API 29+, with a listener), or a battery temperature of 40 Β°C or more (`ACTION_BATTERY_CHANGED`). | +| Low battery | Below 20 % while not charging. | +| Visible activity | Live hashrate, hashes tried, the block height being mined, accepted blocks, battery % and Β°C, and the self-test result. | +| Wallet change | If the wallet locks or changes, mining stops, so it never keeps mining to an old address. | + +Each automatic stop shows its reason ("Paused: battery saver is on"). Mining never restarts by itself: the player taps Start again. + +**Wallet idle lock:** a found block must be signed by the unlocked wallet, and the wallet locks after 5 minutes without taps. While mining is active (which means foreground and consented), each status update calls `touchWallet()` to keep the session alive. The 4-hour absolute limit and lock-on-hide still apply. night-review accepted this trade-off on PR #78. The session can't stay unlocked in the background: hiding the app locks the wallet, and `handleOnPause` halts mining, so the keep-alive applies only to consented foreground mining. Eric may prefer a stricter rule, such as re-prompting for the password when a block is found. + +## Measured hashrate (emulator) +Measured on inspiron-3670 (6 cores, shared with ~7 agents), using the AVD `wikideck` (Android 15, x86_64 google_apis, KVM, `-cores 4`, 2 GB RAM): + +| Measurement | Result | +|---|---| +| Known vector (`--self-test`), x86_64 | passed, 1.45 s including the 256 MiB cache init | +| Known vector, arm64-v8a (through the emulator's ARM translation) | passed | +| Raw engine, 1 process, 2000 hashes | about 53 s β†’ **~37 H/s per thread** | +| In the app, Max (4 threads) | **~125 H/s** shown in the panel, with 4 engine processes at ~260 MB RSS each | + +Light mode is about 10Γ— slower per thread than desktop fast mode. At tonight's testnet target (`00002514…`, about 452 K expected hashes), 125 H/s means **one block per hour on average**, with high variance. On a real phone, expect roughly 20–60 H/s per big core (not measured tonight: no device). + +## Results tonight +Verified in the emulator with the debug APK (`~/worker/jobs/night/mobile-mining/apk/wikideck-mining-testnet-debug.apk` on inspiron): +- The APK contains `lib/{arm64-v8a,x86_64}/libwikideck_randomx.so`. The app runs the self-test before its first start ("known vector OK"), then mines on the testnet (:3101) with live hashrate and block height. +- **Every safeguard halts the engines** (the engine process count drops to 0, and the panel shows the reason): + - thermal: `cmd thermalservice override-status 3` β†’ "Paused: the device is warm" + - battery saver (unplugged, `settings put global low_power 1`) β†’ "Paused: battery saver is on" + - low battery (`dumpsys battery set level 15`, unplugged) β†’ halted (Android's low-battery dialog paused the activity first) + - background (HOME) β†’ "Paused: the app went to the background"; the web wallet locks too, so restarting needs an unlock + - Max intensity is refused while unplugged +- **Accepted block:** at 22:37 EST the emulator (Max, ~136 H/s, 4 light threads) mined **testnet block #92** ("International FJ"; block `edaf8ac3…a8cb0`, NFT `acf778b1…7ee58`) to the in-app wallet `3b2362c7…5e054`. All three nodes (:3101–:3103) accepted it as their tip. That one was lucky: about 41 K hashes against ~452 K expected. + +![Emulator panel after the accepted block](mobile-mining-accepted.jpg) + +## Options for Eric +1. **Keep it sideload-only** (what exists now). Publish a signed release APK from a WikiDeck download page with clear battery and heat copy. This needs a release keystore (not in git) and an "unknown sources" install guide. F-Droid is a possible channel, but its anti-features policy would flag it, and its build server needs a reproducible NDK build. +2. **Store builds without mining.** Ship the store APK/AAB and the iOS app without the engine (a build flag that drops jniLibs and the panel), with the panel replaced by "Mine on desktop, or with the sideload app", plus a remote-management view of a desktop miner (allowed by Google's policy). +3. **Make mobile mining worthwhile.** Phones in light mode are roughly 10Γ— slower per core than desktop fast mode. Options that need **consensus changes** (out of scope tonight): a lower-difficulty mobile lane, or pooled/shared mining where a phone's partial shares earn a card. +4. **Later engineering:** a JNI wrapper instead of exec (needed if a future Android blocks exec from `nativeLibraryDir`), an arm64 device test on real hardware, and battery-drain measurements. diff --git a/docs/night2/PLAN.md b/docs/night2/PLAN.md new file mode 100644 index 0000000..be26b31 --- /dev/null +++ b/docs/night2/PLAN.md @@ -0,0 +1,120 @@ +# 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) +1. **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. +2. **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. +3. **Story:** Edit War "doesn't really tell much of a story with the actual cards". +4. **Feel:** Magic: The Gathering is the model for how it should feel. +5. **Modes:** keep the different modes (classic, draft, trending); Eric likes them. +6. **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.) +7. **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. +8. **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. +- **Where work happens:** in the `claude/wikideck` fork, 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) and `shared/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 (`pageId` repeats). +- **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/`) + +## 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-After` with 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 +1. **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. +2. 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? +3. Is P31 typing reliable enough? Check against the real sample in `docs/game/card-sample.json` and `docs/game/starter-cards.json`. Plan for unclassified cards, which were 14% of Night 1's sample. +4. Can "Connected" link lookups be done within the Wikimedia budget? Where does the data come from, and when is it fetched and cached? +5. 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. +6. What scope is realistic for 4.5 hours with about 10 agents, and what gets cut first? diff --git a/docs/night2/TESTNET.md b/docs/night2/TESTNET.md new file mode 100644 index 0000000..57cb211 --- /dev/null +++ b/docs/night2/TESTNET.md @@ -0,0 +1,67 @@ +# Night 2 private testnet: how to test (testnet-ops, #63) + +**Testnet only, LAN only, on poweredge-r350.** It is never mainnet and never the live `wikideck` namespace. + +## Nodes +| node | URL | game modes (env from Night 1 #22) | +|---|---|---| +| node-a | http://192.168.1.32:3101 | classic, trending | +| node-b | http://192.168.1.32:3102 | draft | +| node-c | http://192.168.1.32:3103 | classic, draft, trending | + +- **Autodeploy:** the nodes follow `night/2026-11-17`. A loop on r350 (`deploy/night/autodeploy.sh`, in a dedicated detached worktree) polls the branch every 3 min. + - On a new head it rebuilds the image and restarts node-a, then b, then c, each after the previous one passes `/healthz`. + - While any match or lobby is live it defers, for up to 15 min. + - Lobbies are in memory, so a deploy that does go through ends games in progress. After night-lead merges, wait about 5 min, or check that all three nodes report the new head, before you start an end-to-end run. +- Ledgers persist in the Docker volumes across deploys. + +## Test wallets +Four disposable wallets: **alice**, **bob**, **carol** and **dave**. + +| wallet | address | cards (confirmed) | +|---|---|---| +| alice | `ff9273368c225698d8ae34430800cfe30b10a1c3d8c21091d42960493db556df` | see #63 | +| bob | `80f17f10ca782efd16783d10d71ce43b2993aadccda36dbd0364dee1921cbc22` | see #63 | +| carol | `f2d908633c4313bd77e86650c13d11ac3e7e656223ebe881cc34ffba3f3e0524` | leftovers | +| dave | `02bb97f202e1616ab97b45e8938e384dcbf622a0b44a7f4c1589f44236d3ccef` | leftovers | + +- Confirmed at height 91: **alice 41, bob 40**, carol 5, dave 5. Block #92 came from the Android emulator (#59). +- alice and bob were consolidated to 40 cards each with on-chain NFT transfers from carol and dave, so **production `deckSize` 40 works on the testnet** and no lower-deckSize test mode is needed. +- **The encrypted browser backups are in a comment on #63**, not in git. + - Backup password: `wikideck-night-testnet`. It is **public and testnet-only**: never reuse it, and never put a real secret next to it. + - Anyone who can read this repo's issues can open these wallets. Keep them on the LAN-only testnet, and never send them anything of value. +- Re-check counts at any time: `GET http://192.168.1.32:3101/api/decks/
?offset=0&limit=24` (pages of 24, follow `next`). + +### Load a wallet in the browser +**First make the node origins a secure context** (found by night-review on #63). +- `http://192.168.1.32:310x` is plain HTTP on a LAN address, so the browser leaves `crypto.subtle` undefined. Open wallet then fails with "Cannot read properties of undefined (reading 'digest')" or "Wallet storage unavailable". +- **Chrome/Chromium:** open `chrome://flags/#unsafely-treat-insecure-origin-as-secure`, add `http://192.168.1.32:3101,http://192.168.1.32:3102,http://192.168.1.32:3103`, then relaunch. +- **Command line:** `--unsafely-treat-insecure-origin-as-secure=http://192.168.1.32:3101,http://192.168.1.32:3102,http://192.168.1.32:3103 --user-data-dir=`. +- **Playwright:** use the full `chromium` channel. The headless shell ignores this flag. +- **SSH tunnel to `localhost`:** this also works for the wallet, but it breaks the Dex callback URLs, so you can't do the login/link step that way. +- **Firefox** has no per-origin equivalent. + +Use a separate browser profile per player, because a browser holds one wallet per origin. +1. Open a node URL, then **Open wallet**. +2. **Recover from a local backup**: choose the backup JSON file (save it from the #63 comment as `alice.backup.json`), and enter the backup password above. +3. Set a new local encryption password (at least 12 characters, anything testnet-only), then confirm it. +4. The wallet dialog should show the address above and its confirmed card count. + +### eom.dev login (Dex) +- There is no new Dex config tonight. The existing `wikideck` client already allows the 3101–3103 callbacks. +- Log in with **Log in with eom.dev**, then unlock the wallet and press **Link wallet …** to link it to the account. +- PvP seats are keyed to the account, and ownership is checked on the server against the account's linked wallets. So for a two-player run you need **two eom.dev accounts**, one with alice linked and one with bob. Which accounts to use is night-lead's call (see #53/#63). Never use a real person's account without their OK. + +## Mining on the testnet +- Mining isn't needed for tests. Only run a miner if night-lead asks for more blocks, or to confirm transfers. +- `deploy/night/testnet.sh mine N [workers]` runs the native multi-worker miner in a container named `wikideck-night-miner` (at most 4 workers on r350). + - Every template costs Wikipedia requests on the node, so it is paced by `MIN_GAP`. + - **testnet-ops stops any miner by 01:55** (`docker rm -f wikideck-night-miner`). The nodes stay up. +- **Difficulty (for mobile mining, #59):** at block ~90, an accepted block took between about 2 K and 130 K hashes. That is up to ~8 min at the 4-worker r350 rate of ~250 H/s. One light-mode thread on the emulator is far slower, so expect a long wait per block, with high variance. + +## Card identity pre-bake (engineer WS E) +- `server/game/identity.ts` is a persistent per-token store (`node:sqlite`). It freezes each card's off-chain identity at first sight and never rewrites it. The identity covers P31/P279 classes, description, categories, countries, years, coordinates and outlink pageIds. Its fields match duel-cards' `CardProfile` (#70), and `toProfile()` returns that view. +- `scripts/night2/prebake-identity.ts --node [--store ] [--cards ...]` reads the canonical chain from one node and freezes what the cached card files know. The store defaults to `$WIKIDECK_DATA_DIR/card-identity.sqlite` (`identityStoreFile()`), and hosts should open it at the same path. + - It **never calls Wikimedia itself**. + - Live facts arrive only through the wikimedia team's client on its `background` lane (#62), once that client has merged. + - Cards that are still unknown stay unfrozen and are retried on a later run. diff --git a/docs/night2/WIKIMEDIA.md b/docs/night2/WIKIMEDIA.md new file mode 100644 index 0000000..3979092 --- /dev/null +++ b/docs/night2/WIKIMEDIA.md @@ -0,0 +1,72 @@ +# Polite Wikimedia client (Night 2, issue #62) + +Every server-side Wikimedia request goes through one process-wide `WikimediaClient` +(`server/wikimedia/client.ts`). The design comes from engineer review Β§4 and data review Β§5. + +## What it does + +| Behaviour | Default | +|---|---| +| Rate per upstream host (`en.wikipedia.org`, `wikimedia.org`, `www.wikidata.org`) | token bucket, 1 req/s, burst 3 | +| Concurrency | 1 request in flight per host | +| Priority lanes | `mint` β†’ `interactive` β†’ `background`; the queue holds 64 waiters, and background work is shed first | +| Longest queue wait | mint 10 s, interactive 5 s, background 120 s | +| `maxlag` | `maxlag=5` on every Action API request; a maxlag reply waits for `Retry-After` and retries up to 2 times | +| 429 / 503 | honour `Retry-After` (seconds or HTTP date), else back off 2ⁿ s with jitter, capped at 10 min, by pausing the whole host | +| Circuit breaker | 3 consecutive 429s stop that host for 10 min. Requests are refused at once without touching Wikimedia | +| Daily cap | 20,000 requests a day per egress IP. Background work stops at 80 %, interactive at 100 %; mint has a 10 % reserve | +| Disk cache | `$WIKIDECK_DATA_DIR/wikimedia-cache.sqlite`: ETag / Last-Modified, `If-None-Match`, stale-while-revalidate on the background lane, stale copy served on refusal | +| User-Agent | `WikiDeck/ (+https://gitea.eom.dev/WikiDeck/wikideck; ) node/` | + +The rate is deliberately 1 req/s for **every** host, including the `wikimedia.org` REST (pageviews) host. +The engineer review suggested 5 req/s there; we are stricter on purpose after the Night 1 rate limiting, because the +budget is per egress IP. Raise it only with a reason and a per-host setting. + +Cache lifetimes: article metadata 24 h, monthly pageviews 7 days (the URL names six closed +months, which do not change). Random articles and all mint reads are never cached. + +## Operator settings + +| Variable | Meaning | +|---|---| +| `WIKIDECK_OPERATOR_CONTACT` | **Set this.** An email address or URL, put in the User-Agent. Without it (and without `PUBLIC_ORIGIN`), the node logs a warning at start-up. Wikimedia policy requires a contact, and contact-less clients are the first to be blocked. | +| `PUBLIC_ORIGIN` | Used as the contact when `WIKIDECK_OPERATOR_CONTACT` is unset. | +| `WIKIDECK_USER_AGENT` | Overrides the whole User-Agent string (sanitized; kept from Night 1). | +| `WIKIDECK_WIKIMEDIA_RPS` | Requests per second per host for the **whole egress IP** (default 1). | +| `WIKIDECK_WIKIMEDIA_BURST` | Token-bucket burst (default 3). | +| `WIKIDECK_WIKIMEDIA_CONCURRENCY` | In-flight requests per host (default 1). | +| `WIKIDECK_WIKIMEDIA_DAILY_CAP` | Requests per UTC day for the whole egress IP (default 20000). | +| `WIKIDECK_WIKIMEDIA_NODES_PER_IP` | How many nodes share this egress IP. The rate and the daily cap are divided by it. **The testnet runs several nodes behind one IP: set it to the node count** (e.g. 3 for `deploy/night/compose.lan.yaml`). | + +The testnet's `WIKIDECK_USER_AGENT` already names the project URL, which satisfies the policy. + +Counters (`lane.*`, `http.429`, `breaker.open`, `cache.hit`, `refused.*`, …), per-host pause state and the +mint pool's state are in the private operations listener's `/status`, under `wikimedia`. + +## Mint path: transport only + +- `random()` (W1) and `getFresh()` (W2 and W3) keep their request parameters byte-identical. The only + addition is `maxlag=5`, which changes only error behaviour. `tests/wikimedia-mint.test.ts` pins the exact URLs. +- Mint reads use the `mint` lane and **never** read or write the disk cache, and never join a display read. +- **Fixed:** a 429, 5xx, timeout, network error or non-JSON reply on the pageviews call used to mint a card with + `attention: null` forever (`enrichment.ts`). Now `getFresh()` rejects, the template returns 503 and the miner + retries. `unavailable` is minted only for a genuine 404 (no data) or missing months. +- No block, transfer, trade or validation code changed. Validation never calls Wikimedia. + +## Mining prefetch pool (`server/wikimedia/pool.ts`) + +Each template used to cost 3+ requests, all in a burst at each new tip, so load scaled with the number of miners. +Now every template on the same tip gets the same fresh article+snapshot pair (miners race for one block anyway), +and a new tip takes the next prefetched pair. Load is about one pair, or 3 requests, per block, whatever the number +of miners. + +- Pairs come from the mint-path reads above, and the snapshot is stamped when the pair is fetched, so `capturedAt` is true. +- Pairs older than 5 minutes are dropped, never served. +- The pool (2 pairs) refills only after use, so an idle node makes no requests. + +## Card faces + +`/api/wikipedia/:id` β†’ `get()`: memory LRU, then the disk cache (fresh, or stale with a background +revalidation), and only then the interactive lane. A grid of cards therefore no longer means a burst +of 2 upstream requests per card per render. `TrendCache` can use `getBackground()` to stay off the +interactive lane. diff --git a/docs/night2/analysis/connected.py b/docs/night2/analysis/connected.py new file mode 100644 index 0000000..fa5f91a --- /dev/null +++ b/docs/night2/analysis/connected.py @@ -0,0 +1,44 @@ +"""How often random card pairs share cheap relations. Usage: python3 -I connected.py """ +import json, sys, re, itertools, collections, importlib.util, os +cards = json.load(open(sys.argv[1]))['cards'] +spec = importlib.util.spec_from_file_location('ty', os.path.join(os.path.dirname(os.path.abspath(__file__)), 'types.py')) +ty = importlib.util.module_from_spec(spec); spec.loader.exec_module(ty) +GENERIC = re.compile(r'stubs|living people|\d+ (births|deaths)$|articles|wikidata|pages', re.I) +COUNTRIES = ['United States','American','England','English','British','France','French','Germany','German','Japan','Japanese','China','Chinese', + 'India','Indian','Brazil','Poland','Polish','Italy','Italian','Spain','Spanish','Austria','Canada','Canadian','Australia','Australian','Russia','Russian', + 'Mexico','Mexican','Iran','Pakistan','Bangladesh','Sweden','Swedish','Norway','Estonia','Ukraine','Croatia','Philippines','Cuba','Israel','Portugal','Scotland','Wales','Ireland','Kazakhstan','Malaysia','Argentin','Belgi','Iceland','Bermuda','Thailand','Singapore','Sri Lanka','Slovenia','Moldova','Cyprus','Macedonia','Mauritania','Congo','Gibraltar','Hong Kong','New Zealand','Korea','Indonesia','Aceh'] +NORM = {'American':'United States','English':'England','British':'United Kingdom','England':'United Kingdom','Scotland':'United Kingdom','Wales':'United Kingdom', + 'French':'France','German':'Germany','Japanese':'Japan','Chinese':'China','Indian':'India','Polish':'Poland','Italian':'Italy','Spanish':'Spain', + 'Canadian':'Canada','Australian':'Australia','Russian':'Russia','Mexican':'Mexico','Swedish':'Sweden'} +Y = re.compile(r'\b(1[0-9]{3}|20[0-2][0-9])') +def feats(c): + txt = (c['description'] or '') + ' | ' + ' | '.join(c['categories']) + ctry = {NORM.get(k, k) for k in COUNTRIES if k in txt} + cents = {int(y) // 100 for y in Y.findall(c['title'] + ' ' + txt)} + cats = {x for x in c['categories'] if not GENERIC.search(x)} + p31 = {i['id'] for i in c['instanceOf']} + return dict(ctry=ctry, cent=cents, cats=cats, allcats=set(c['categories']), p31=p31, type=ty.classify(c)[0]) +F = [feats(c) for c in cards]; pairs = list(itertools.combinations(range(len(cards)), 2)); N = len(pairs) +def rate(f): + k = sum(1 for i, j in pairs if f(F[i], F[j])); return f'{k}/{N} ({100*k/N:.2f}%)' +print('pairs', N) +print('share any category (incl. generic)', rate(lambda a, b: a['allcats'] & b['allcats'])) +print('share specific category', rate(lambda a, b: a['cats'] & b['cats'])) +print('share P31 class', rate(lambda a, b: a['p31'] & b['p31'])) +print('share P31 excl human/taxon', rate(lambda a, b: a['p31'] & b['p31'] - {'Q5', 'Q16521'})) +print('share country (text proxy for P17/P27)', rate(lambda a, b: a['ctry'] & b['ctry'])) +print('share century (text proxy for dates)', rate(lambda a, b: a['cent'] & b['cent'])) +print('share type', rate(lambda a, b: a['type'] == b['type'])) +print('country OR century OR specific cat', rate(lambda a, b: (a['ctry'] & b['ctry']) or (a['cent'] & b['cent']) or (a['cats'] & b['cats']))) +print('cards with >=1 country', sum(1 for f in F if f['ctry']), 'with >=1 century', sum(1 for f in F if f['cent'])) +# deck-level: chance that a random 10-card hand-pair (10 vs 10, own deck) has >=1 connected pair within a deck +import random; random.seed(1) +def deck_hits(pred, size=10, trials=2000): + h = 0 + for _ in range(trials): + s = random.sample(range(len(F)), size) + if any(pred(F[i], F[j]) for i, j in itertools.combinations(s, 2)): h += 1 + return f'{100*h/trials:.0f}%' +pc = lambda a, b: (a['ctry'] & b['ctry']) +print('10-card deck has >=1 same-country pair', deck_hits(pc), '| specific category', deck_hits(lambda a, b: a['cats'] & b['cats']), + '| country-or-century', deck_hits(lambda a, b: (a['ctry'] & b['ctry']) or (a['cent'] & b['cent']))) diff --git a/docs/night2/analysis/fields.py b/docs/night2/analysis/fields.py new file mode 100644 index 0000000..f08b07e --- /dev/null +++ b/docs/night2/analysis/fields.py @@ -0,0 +1,23 @@ +"""Field availability for rules-text generation in card-sample.json. Usage: python3 -I fields.py """ +import json, sys, re, statistics, collections +cards = json.load(open(sys.argv[1]))['cards']; n = len(cards) +Y = re.compile(r'\b(1[0-9]{3}|20[0-2][0-9])\b') +def share(f): k = sum(1 for c in cards if f(c)); return f'{k}/{n} ({100*k/n:.0f}%)' +print('description non-empty', share(lambda c: bool(c['description']))) +print('wikidataId', share(lambda c: bool(c['wikidataId']))) +print('P31 present', share(lambda c: bool(c['instanceOf']))) +print('>=1 non-hidden category', share(lambda c: len(c['categories']) > 0)) +print('categories truncated (cllimit 50)', share(lambda c: c['categoriesTruncated'])) +print('median categories', statistics.median(len(c['categories']) for c in cards)) +print('year in title', share(lambda c: Y.search(c['title']))) +print('year in description', share(lambda c: Y.search(c['description'] or ''))) +print('year in categories', share(lambda c: any(Y.search(x) for x in c['categories']))) +print('year anywhere (title/desc/cats)', share(lambda c: Y.search(c['title'] + ' ' + (c['description'] or '') + ' ' + ' '.join(c['categories'])))) +print('births/deaths category', share(lambda c: any(re.search(r'\d+ (births|deaths)', x) for x in c['categories']))) +print('establishments/completed category', share(lambda c: any(re.search(r'establishments|completed in|disestablish|opened in', x) for x in c['categories']))) +print('living people', share(lambda c: 'Living people' in c['categories'])) +print('stub category', share(lambda c: any('stubs' in x for x in c['categories']))) +print('country/nationality word in desc or cats', share(lambda c: re.search(r'American|British|English|French|German|Japan|China|Chinese|India|Brazil|Poland|Polish|Italy|Italian|Spain|Spanish|Austria|Canada|Australia|Russia|United States', (c['description'] or '') + ' '.join(c['categories'])))) +print('legacy category on-chain', collections.Counter(c['legacyCategory'] for c in cards)) +print('pageviews available', share(lambda c: c['pageviews']['status'] == 'available')) +print('languagesTruncated', share(lambda c: c['languagesTruncated'])) diff --git a/docs/night2/analysis/stats.py b/docs/night2/analysis/stats.py new file mode 100644 index 0000000..4b7d2be --- /dev/null +++ b/docs/night2/analysis/stats.py @@ -0,0 +1,59 @@ +"""Proposed percentile -> cost/power/toughness derivation, evaluated on card-sample.json. +Usage: python3 -I stats.py """ +import json, sys, collections, statistics, itertools +d = json.load(open(sys.argv[1])); cards = d['cards']; P = d['percentiles'] +def pct(s, v): # DESIGN 1.1 counting: cut points strictly below + half of equal + if v is None: return None + cut = P[s]; return int(sum(c < v for c in cut) + sum(c == v for c in cut) / 2) +TH = [26, 39, 51, 63, 78] # v1.1 costThresholds (fame -> cost 1..6) +BUDGET = [None, 3, 4, 6, 8, 10, 12] # P+T per cost, MTG vanilla curve (2/1, 2/2, 3/3, 4/4, 5/5, 6/6) +def derive(c): + a, dp, r = (pct(k, c['stats'][k]) for k in ('attention', 'depth', 'reach')) + vals = [x for x in (a, dp, r) if x is not None] + fame = int(sum(vals) / len(vals) + 0.5) + cost = 1 + sum(t <= fame for t in TH) + b = BUDGET[cost] + kw = 'Multilingual' if r >= 75 else ('Local' if c['stats']['reach'] == 0 else None) + if kw == 'Multilingual': b -= 1 # evasion-like keyword is paid for out of the body + if kw == 'Local': b += 0 # Local = gains +1/+1 next to a same-country Location (conditional, no tax) + share = (a if a is not None else 50) / max(1, (a if a is not None else 50) + dp) # attention vs depth + pw = min(b - 1, max(1, round(b * share))); t = b - pw + return dict(title=c['title'], a=a, d=dp, r=r, fame=fame, cost=cost, P=pw, T=t, kw=kw, + trend=c['pageviews']['trendPercent'], daily=c['pageviews']['dailyAverage']) +rows = [derive(c) for c in cards]; n = len(rows) +def naive(c): # straw man: power = attention tier, toughness = depth tier, cost from their sum + ti = c['tiers']; pw = (ti['attention'] or 1 + 1) // 2 + 0; t = (ti['depth'] + 1) // 2 + return dict(cost=max(1, min(6, round((pw + t) / 2))), P=pw, T=t) +nv = [naive(c) for c in cards] +def dominated_pairs(rs, use_kw=False): + k = 0 + for x, y in itertools.permutations(rs, 2): + if x['cost'] <= y['cost'] and x['P'] >= y['P'] and x['T'] >= y['T'] and \ + (x['cost'] < y['cost'] or x['P'] > y['P'] or x['T'] > y['T']) and (not use_kw or x.get('kw') == y.get('kw')): + k += 1 + return k +print('cost distribution', sorted(collections.Counter(r['cost'] for r in rows).items())) +print('power distribution', sorted(collections.Counter(r['P'] for r in rows).items())) +print('toughness distribution', sorted(collections.Counter(r['T'] for r in rows).items())) +print('keywords', collections.Counter(r['kw'] for r in rows)) +print('P/T by cost:') +for cst in range(1, 7): + g = [r for r in rows if r['cost'] == cst] + if g: print(' ', cst, len(g), collections.Counter(f"{r['P']}/{r['T']}" for r in g).most_common(6)) +pairs = n * (n - 1) +print('strict-dominance pairs proposed', dominated_pairs(rows), 'of', pairs, '; same-keyword only', dominated_pairs(rows, True)) +print('strict-dominance pairs naive ', dominated_pairs(nv), 'of', pairs) +# efficiency by fame quintile +q = sorted(rows, key=lambda r: r['fame']) +print('fame quintile: mean cost, mean (P+T)/cost proposed | naive (P+T)/cost') +idx = sorted(range(n), key=lambda i: rows[i]['fame']) +for k in range(5): + sl = idx[k * n // 5:(k + 1) * n // 5] + print(f" Q{k+1} fame {rows[sl[0]]['fame']}-{rows[sl[-1]]['fame']}: cost {statistics.mean(rows[i]['cost'] for i in sl):.2f} " + f"eff {statistics.mean((rows[i]['P']+rows[i]['T'])/rows[i]['cost'] for i in sl):.2f} | naive eff " + f"{statistics.mean((nv[i]['P']+nv[i]['T'])/nv[i]['cost'] for i in sl):.2f}") +top = sorted(rows, key=lambda r: -r['fame'])[:6] + sorted(rows, key=lambda r: r['fame'])[:3] +print('examples (top fame, bottom fame):') +for r in top: print(f" {r['title'][:34]:34s} a{r['a']} d{r['d']} r{r['r']} fame{r['fame']} cost{r['cost']} {r['P']}/{r['T']} {r['kw'] or ''}") +tr = [r for r in rows if r['trend'] is not None and r['trend'] >= 25 and (r['daily'] or 0) >= 20] +print('trending (+25% and daily>=20):', len(tr), f'{100*len(tr)/n:.1f}%') diff --git a/docs/night2/analysis/types.py b/docs/night2/analysis/types.py new file mode 100644 index 0000000..1d8cd3f --- /dev/null +++ b/docs/night2/analysis/types.py @@ -0,0 +1,79 @@ +"""Classify card-sample.json into Figure/Location/Event/Institution/Doctrine. +Order: P31 label rules (first rule that matches ANY P31 label wins, rule order = priority), +then category keywords, then description keywords, then deterministic fallback. +Usage: python3 -I types.py [--list]""" +import json, re, sys, collections +RULES_P31 = [ # (type, regex on a P31 label). Order matters: specific before generic. + ('Doctrine', r'aspect of|aspect in|disease|clinical sign|list article|chemical entity'), + ('Event', r'election|protest|battle|war\b|storm|nor.easter|cyclone|tornado|earthquake|disaster|event|match|final\b|' + r'season|championship|tournament|\brace\b|grand prix|scandal|annexation|treaty|incident|festival|referendum|' + r'conference|ceremony|time period|delegation'), + ('Institution', r'artificial satellite|space station|space telescope|spacecraft|space probe'), + ('Location', r'planet|natural satellite|\bstar\b|galaxy|nebula|planetary system|astronomical object|rainforest|reef|' + r'civili[sz]ation|empire|historical country|archaeological site|' + r'human settlement|settlement|village|town|city|commune|municipal|parish|county|district|region|province|' + r'township|hamlet|townland|census area|local government|community of|island|river|lake|mountain|plateau|' + r'waterfall|valley|bay|peak|geographical feature|historic district|park|state park|square|road|highway|' + r'building|castle|mosque|church|temple|cathedral|house|home|museum|station|bridge|monument|historic site|' + r'military base|battery|refinery|shopping|stadium|arch|tower|fort|palace|columbari|council'), + ('Figure', r'^human$|fictional character|stock character|person|deity|orisha|loa\b|taxon|species|genus|breed|' + r'^family$|organism'), + ('Institution', r'company|business|organi[sz]ation|association|society|party|agency|studio|band|musical group|team|club|' + r'university|college|school|institute|diocese|ecclesiastical|manufacturer|newspaper|magazine|film|album|' + r'song|single|musical work|composition|television|series|book|novel|video game|painting|award|position|' + r'aircraft|ship|steamship|vehicle|automobile|tram|railway line|route|typeface|software|product|brand'), + ('Doctrine', r'concept|theory|theorem|mathematical|programming language|language|gene|protein|chemical|compound|' + r'disease|clinical sign|ideology|religion|discipline|field|cuisine|food|dish|drink|aspect|list article|' + r'particle|process|genre|form\b|game\b|branch of|class of|type of|tabular'), +] +RULES_CAT = [ # fallback on non-hidden category titles (lowercase) + ('Figure', r'\bbirth|\bdeaths\b|living people|people from|\bspecies\b|described in \d|\bgenera\b|deities|characters'), + ('Event', r'\belections\b|protests|\bbattles\b|disasters|\braces\b|\bseasons\b|\bevents\b|scandals|annexations|competitions'), + ('Location', r'villages|communes|parishes|local government|populated places|geography|rivers|islands|buildings and structures|bridges|' + r'stations|parks|districts|townships|cities and towns|historic places'), + ('Institution', r'companies|organi[sz]ations|\bfilms\b|albums|songs|novels|newspapers|television series|musical groups|' + r'aircraft|ships|typefaces|software|awards|teams|clubs'), + ('Doctrine', r'theory|structures$|algebra|terminology|cuisine|drinks|desserts|ecology|languages|diseases|conditions|' + r'concepts|ranks|etymology|maps|atlases'), +] +RULES_DESC = [ + ('Figure', r'\b(painter|politician|actor|writer|player|born|species|genus)\b'), + ('Event', r'\b(race|election|battle|match|protest|storm|war|competition)\b'), + ('Location', r'\b(village|town|city|river|island|building|church|columbarium|station|park)\b'), + ('Institution', r'\b(company|band|film|album|organi[sz]ation|team|aircraft|ship|newspaper)\b'), + ('Doctrine', r'\b(concept|theory|structure|dessert|drink|dish|technique|class of)\b'), +] +TYPES = ['Figure', 'Location', 'Event', 'Institution', 'Doctrine'] + +def classify(card): + labels = [i['label'].lower() for i in card.get('instanceOf') or []] + for t, rx in RULES_P31: + for l in labels: + if re.search(rx, l): return t, 'p31', l + cats = [c.lower() for c in card.get('categories') or [] if 'stubs' not in c.lower()] + for t, rx in RULES_CAT: + for c in cats: + if re.search(rx, c): return t, 'category', c + desc = (card.get('description') or '').lower() + for t, rx in RULES_DESC: + if re.search(rx, desc): return t, 'description', desc + # deterministic last resort: Doctrine (the residual "idea" class); never hash-random. + return 'Doctrine', 'fallback', '' + +if __name__ == '__main__': + d = json.load(open(sys.argv[1])); cards = d['cards'] + res = [(c, *classify(c)) for c in cards] + n = len(res) + by_t = collections.Counter(r[1] for r in res); by_src = collections.Counter(r[2] for r in res) + print('n', n) + for t in TYPES: print(f'{t:12s} {by_t[t]:4d} {100*by_t[t]/n:5.1f}%') + for s in ['p31', 'category', 'description', 'fallback']: print(f'src {s:12s} {by_src[s]:4d} {100*by_src[s]/n:5.1f}%') + print('labels w/o p31 match but has p31:', sum(1 for c,t,s,w in res if s!='p31' and c['instanceOf'])) + print('cross-tab old faction x new type') + ct = collections.Counter((c['faction'], t) for c,t,s,w in res) + for f in sorted({c['faction'] for c in cards}): + print(f' {f:14s}', {t: ct[(f,t)] for t in TYPES if ct[(f,t)]}) + if '--list' in sys.argv: + for c,t,s,w in res: + if [i['label'] for i in c['instanceOf']] == ['human']: continue + print(f"{t[:5]} {s[:4]} | {c['title'][:42]:42s} | {w[:40]}") diff --git a/docs/night2/mobile-mining-accepted.jpg b/docs/night2/mobile-mining-accepted.jpg new file mode 100644 index 0000000000000000000000000000000000000000..c05457a4c78a830edfc6155dea0c7087dafc5764 GIT binary patch literal 17643 zcmd_R1ymf{wl>(KyY`r-~j@`-GaMoa0xB}LSwWL5P6E8%=bnAf z{_nf@y!+qtzcJnzuX?PmS=F^>uUS=dP5I_}S$x?5yporelLo-R001!158wp?kOUyY zBOoHcBO)RoA|W9nqrO5#ML|Ku#l%8?MSx34NPvrvPfSKbK}#xU|`{(<3&P7K}CaJ0Dc94g@J>Eg@;2xfQN@(?FaoG0FRA;^M+j< z@wJLE(px87j=+Q*WGad3EWu9scUFzY3rDpeKxnSw6b<_b#wRd^zsf42@MO6_!^m*^es6h^?MpHH!r`Su&B7C zw5GNWT;I^x)ZE?E+t)uZI5a#xGdnlGu(-6mxwXBsySIOEcy#&m>iXvP?*8HN54m6f zaQ`M2^!wig`wwzqL*;^nhlhhl`a>=lSPy7}!-hwA!;Xj}u7YIj^!hDFATq8*LQZuT z3Kgg71)hoX6e>P7*Cx&7AENzDvj3i7LH{Gk{#~$t$h8bWhl7DWJUDECDB$5ak`9!B z_5xt~`~q$!<+Kp{2o2$BAnIZ{uzo9129Pr2>dWs?Xt3kAYVwu?g&fZ^MuiWgLn*ZMqMC-U-0B0-D z-<+$cbMu}jXI=m;E{`ftIYlo3_x2GQE z0$6Q&qT4l+lal%Op1&lOpHC+aWf)=Q|8GO!*TPXzc>(;{@!$V;xHB;_?(ZExWZlwr zSA}Nr{3@?;yFKiJ4n-JG`Ii#K!(GzzGuB1kU&!P@=g6X`BCOxPhF$>vNcSp#rH4D4 zq&_{*gg^W3yZ}0af7AVy-Zj$8EqMW0^}GN?e)_L>J>&ZSg?6rDQBi|Ry7>ag_7Xkc zcmbe_{`G)gi-4}wf7$T`FwvTQci|sO@fVu39POLB=qaE7{+jZyd(rN=e~_^n2*V87 zw;7^W=d@41DK=&PLNdbc{{LRgFBBd36gxKQWQ;1{_o!=X=pb=G?G9ECUYa_dF#@iN z8hpz70@3Mso600p*xt7xXY_ly{>iWD0vU2Xuuv)0J-!Lv!}T;+o)>#w|r z$TGPA6)D_+YSW$%J*B<96iVz*)@@p~FM!mz$F240vPl>z+>bC)G|T`fkN>pcnULFp z#1Bx}9(N)uH7H*Iae|fiNLN2lum6h<{}rQuc3$o;;>>FNLrgB{@IC=@Bk5rLccVMb z;`SISbY1`{94~-o(eI^o-=Vif77gG3=j97PPxn#XyV~Lfz)Eq`*HNJP1GYIk{PuR* zz`8-xy=v7jTnTtYSEN6cst42PL3$0+X$PJ{ZQB%i>_qG5~RY17%x0;HLXz#JIPUT#ToQhLY&bA(psiTk)J?0!wuOh#o`n zp4T9T7FJ~IX6~48itlntEt|_#Q*2teIVyVnl9L<(alLBO;2T^!Ke^8r`rq0q7P#$r zb%Ku8hCeGfYtaHj%+8SFR|C$(`^>FHQ0K2tc@!Yu-z=e)P2eb1FrluyHp3+&HZ!gh zSf-9_6=)S!D;!6#oWk}Ja`p=FA?>bs(bg*pYFwI!oNke+c2#DpEim`BERVdxhU}A! z|Ngzow*_`8d;wG%-Xn0oMpD1PZzqE$r?ECS^)AtCo-(~QNba=Hn>F@EpX&WWs}x9OI8$M2Q=%=R0Xj~BuxcQc?gJG^rI`TDDg+w{KfuLS33e1O+Uv2z6__Z{+$^Fj(P zB;zI>Q`7yhrj%*0#gvbjSX^0eF5Q#-3T-aLt_a$ysvE*x-@{%~WQzpP%%{h2`}tSM zSbpE{=GDMo{;iXlbzDYgoJ%MHA7eoj)OS{Di-Ya&AOM@`}kgmZR$_y z=HZcU>{qzzWJkM3MPaBCX8GL_>nG=XMZ~SWU-JFsO@2dOuuaCH@6fLq&o$bd*-CHK z%)!fnN6q`=K@pSd*9!pphIgX9?{2-oZ?Y)TH_$7{WiE%^@@$_j)cUqf67P&MA-`(_ zaa*J$mWgp&dNXTBGsk4A5qb71p)9dcYhAQ;!axA^k|A>Pqjh(N>LNog#pS-+3jpx! zW>7Bv0wDJ=yujMmir0jy)gP+$f1<%EINaYyJ#GFz`ZS+g51k_-I@T!03xutHK&PcY zv{dY$81}zRM{`l44-QaW)`3n;8rN;|S8{C%Z9IFrHs1!dsrdMWWu{A2B;4mgUA<$PIPd4 zDRTL&Tya!c<11d%2-KMKselu|IbvDT>(b%fU=boM_I{VM1~ z^BR#U0^@tEMCtbrrGoZ&|74-^@8iTnzztLW_oKgzT3ib7f9kx}&$oZO(SY?$Ij)Fm zWTT-EXXaE0aWm6Das&P_Jw@R32MXCRPyq=e?E5nce5r z-Bq2B{m3Cvh}~jW0Ku>mH#j&h=o7(JRh=gMyCVImQ2%TXL(}lvSL*rV*^T~KMc03z z*YF%`Up1?45;{?QfQ_X4f$$F-54QQ!rx5AUx|cCa zHXj`JbeHU@5*4aSbw?OrP+RGC?%n~h(>%7K(!aALS1={oRAu=d60N_HK&GW7lM!QA zQpVHkV{+EjUW6n#HmD*e1f)ofqY!nHW)YCt`1g2QggBgE>*MMkH7DQPOEtDNq>kuX zQQT{Abg(JyWO?<;ZTKTC8;)&d*I6xiA5Le!2|}Z9&Eq7JKU)p%pL>`2-O^ddzQe63 zpAp@$DsmT;>L}`2I4yA9Cn|S|`)G?l#axj&uw>2&sXNf>-6!ftz9w_|biX#gJfNYg zYlrwtGLib}v~6ck!^E47MjDY(S!srgjJ8|A9lXV;uqvS_?`0Z>W)q0oN9u{*SLNKB zg(S}nhspX%zYkY|SfWPKb-{6@?kpyqBw!yw2??IKti&3{8&}5ovn3q9Lv0Si*Bk0A z;c&dX?Fv*@EYC0nLAfj&{eQ(3`*S7gY<*T8Q26J>8+92rCguiOxZCB5pCMZBP7`0;5G3gq*Ii){pm(Na;)GrI|B2D=4IgZk6+aU5<|znqRlj zdV(n2-NJ$3+M0R=dZ1_CR}yE;!ZK6GHM1g z61phw$QZy4VLP*26j;JBIl8N=kGk(O&k%=@mtju^hN5pK_>0Vm@oa?@nG?cCs;ZnE z_!}E=s3_iig%5pbb`;o4v)B@hQpX^xNNZANlXCp{kPtpDgM?Jlzu}|_HiWt;=ILHu zj`jBS@6n2lo8@R4;5P`woDr=@pV3-pxtZVfNLBwl1Gy&8qRP2aj1kg&C&g$QK=t;X zGAAar!<)2e$DZTT7ePCYtI^XQqYqH9a84>6ias&P->hB+6KrNj3|Zc4p?%-veXUC} z`1{}^%Sp2Zfh3$ z0U|D*!e^P-lZhF34agH$=@m(N6NI&s=^wR|`V1(zIJvmk;bpPr5^4^`C$yZK+T&hL z$OC_Md-Htd{R$S=Ksj?ALF)zA*44MDeqL`Z@sd6PlqCx6Y)AT*vv{@PtypJ~PrjWM z5-dg=DWkx!zGxjaBe$*J<51s*$4ZX}@SRV{v({z8sa?2NlpoX+howB)PRT^22Xg3@ zheX5G8TWGrCPeDxxP<3M(xXH3B!IuRM98xU)YN$T3w*mNuISj_V!aE$DpA(4gephj zAE6)Y3t)uEf0bfXT?hP+)Qi<0(PTV=`71b zc7pQ5HPj7_t=$T1L5lD-cJi>I1TNF%*2jKKhtK6k)nheMk|qBRiqpHaugvvi?c#aF ztYj_)M;Cf-INi1G^=~e2we~0BHhtH+iP1b2;hTOYgIE*v@140f6SxS%PW9IWjV>OB zsQROJRV^5*-{*5H2+Lzoxt7-_>AgG1i}{%ERCQ7y_6Y*qs@MlEEuHRqW`4`#U{_U( z#vU+X5b*6Xo%XdWT84Pa?YGy>)cJiro1`gB^QH+q5+a-CGXDM!lg(M+x{@a!fEj?Q zqqy=4YF@+sSpeKW(Z0VNp@?py-U7W5xS(0>V4fB&`3hy>YFWoW;1lb9*wRNc&PkcL-@6L z)*Ig5nk#7`2uVPi(^YmIJ>d=a^s<3&Wdv6$0b4*jn&*gDaQM&c-Er?X0)Po;c@RcObF?K0fgBU8?ae2s2 zuqE=maffSsg~d;5(#qx7xnbrVd7?XjhD#7v=;<#%16CN+S@Sve+pK5nv6XPoF`f-n zRA>b9+r53>SLgtDR3{BLHyBeZ*YV7gVPYYs@MrnS(Wcc>Cn32XChAhp>F5N-xwg)P zWnad=0Q#M8|?Q!U2_h9Ns4NKPi6{p?!MK%0rH3@fZ*p(a<{!Nb?Q3%--A z6J16ndjF!5y7L-W-Q~6EOkKr0Wh97a?h8Pxqbgoec!2+04B(o->nJ}^cmL_r#cE3WX3kUc?)T?~@_IK|-=?>UrLqGwk&bP( z{Wh@|DP>+xWk(tUh-pPbMb@a)>B@7oSOg>E+f;ZDfz&&%yg(Fi(?Kvt^j8RRN|&K~ zXVW6Tl*JMTyz!wNDxV{tr(8A zJ?<1DbJT-XLYMhE+iQy2LxJ7C^~FMVUBrk!=foP`?|FQxPF++Y*C$k|xy^zd=!A7% ztT~Ozy%Id`iA#B3gX1}3zuck_ZD__zy3ezXKR)l; zQ86drYi2A|MyI*1&tBr~u+%;?SQ?S|H1b)$H&*U5BwKPoK1CUcuccZl%W|`cgT8udrb&;Gmbv0l7-8Vg;!E}2)>z1Yb7QZ~B^?-DP4I#))VcV>B zbn?AW;tPOd+sR&f4nA<@ms-Ms#uNksel8(vZO|QSr&=XaH)%<``WYlXfHa>O(3RW# z?ZR!uN@AzA+a1hnoxAeA-qd}D#i=pYDb99=rIp(byD^MeF26Ns$$pKM3ec~v9bmUo zg^}UPcP#Z?Z_g6cf7N}vAkY*n?~`5I^BHe+F`(u5aN}}LtQ>QO8O%h1dh12aB1sw; zZHTfuk}uQnWPi-`oqI`iLJ&{A*XbWT=s?*TGpCf7;Ft{TJRNp0f*2*=X9*?YpUT@B zNn%xgj&c@`EOt4w+x3kNmhuRi@qu+aX9mb8mQ{M&#h}z*uuJ>OU_&&X)}};8*A4BAM>U1bd!tC~(j&CbPL4mRWldM|Oz~(SqI68i2j0-<%>T$(I#)-RJIVE= za%pEfZwaHmVo%Gog6RjKeiE3|H|&`@T((}}-sUQxauf=B8_$M>J(Nfoebspmje_Vfb_2fL@bsIrv*p#4N#jTgw;w#3a3;xYcLM^7)qr<5FeqHbSJ&BL~%E!0y^`D zhb;MWH!V1TX!MN@P;e%(>-lJ?8TtA>c&5cBK6uY)ny{a@sxCMh1Q$UH`nLLM(|vfh zLa;+=0Z!A|1X0ARKX`y{t;nhL?w94U>X|M9KQbtHE*R}0-OnU7c1X$#XJDy0?g-Ni zIlI~+u(lG_3i8M;ExajrpN)=dvvjpzkzTxcUFL?f08V~%+;Dm`1{%;Kf`#k;je_U) zsHUP@%Ft>P&o`>c=t(!9&&`ptu2Jftl1N`ych(#IJu{-+2jmZ_E~HvTF)D9PCAQS& zRE)FMrW|3rs7^3{TkQ3`;@hxjle}o?s`9MVq*!ji(XnED+xa;TW+&~chHH>Y2*+~+ zmFX5OFMa+-V~%*yixFL8%1fp2)+IV=gqJo+8@zb$FEJgKRC%m3+0s}uLmRuqY?nbb zI6ewvL3#R-U?xdj$SGIrP)4?O+F<*HxZ-}5S(`3t|CuND zSFh|(n$glTRW)pRc&&TShR)7(83#pMvVN-%GMnfx-v?TN0x+T1%C9<-i)~&H_+Cy> zySrbQ1rpljoFg7*W)+OLU!JCWb)R#e8n%-!EeT9x* z%twt0Q=$Co_;zb=$7=q9t9Gf+_AYQSvt1_)#v87G<(DR{6agB^3*aKLMV?rJPTydT zndMar3`ZeP1JbT>oihU+crfYoV|_ZDmL5EY-JU3V+A`!SaJ-`sA$Kfd2m&=*)+Y+E)^!d`p;<;U}jGVEj_xO`J_$LFp1 zE&XYjmk0ljLwEEF!WG>!%mj&`r1)-;L2Ucw4KuvSbN||-r}i3=Iqfcs$E#sJ>T|Oc7l}k2G;wPaCP!J55z1>L-G=FOr^*MQeqRO;n{IltRNA)rGDMa# zWPFY~Fj4pzCz1tfn*LwYU2b1ykyM*4G?JJvL?Eug{Bm9r@5?DzcS`|_ivkp4h>QbtL;ak6+>9uB^XFWQ>v-1fnDf`w zxIi;^jri3SuTuP}9KLwDq@NcY!Y+DeWw*kT{lM@@FryVni1A(ZTS1ADW+f0VtoRPh zL=K3A7TzLwzH+2Ye<%lXh%l?wBe=rA5TGLsz&BkF{KFSy^6s2%<*&Hc9q*9luio@oe|68OSe>NZkl6ik2qlu0K{pJ^Hx^PmAwB?r zG2l#!ZT*OeDT5g6Sbh8j|EVuK%ItzR-K#=))QO28B23cO*~}Q5hBO@D(YaUk%;J@( zoTF!*rT67+;s|jxb`>MG##_;Eq;Keh)EtEw1K@*@sj*j7)`bt8r@M@DBN?RsnV%Ndb`_ZkP&t!h@;bbj*yd5chiuH zzJ5`t2^3Klney4wT3JQYa0{J0+YTUfMi%0g53@tR9D}CkyDVv8+=W&ec+8hco}MC#Pd& zo*5qm66?fl3oqaTA(2SAYCIGF`hXwXaC^C8Aa?gk7uQ5qbxGA5tJw*tV2GZU8zEP$ z+vi17X24u6&Ab~5&HNEjT9AL!j@%cPa;@?7qK+v_+*=z)W~w-&wgdfY9T#x+u&CMs z3eod5HET90*XWkp-9~JA@qR_zS^i;>Fm&AqO$}t^g5OP6Qe6V3E@E7#8R*AxcVJ1f zf|0nPf#R28KPBp4eif&+`A5C>(f!9HY$jNOF2T?{LICxzenj=)tSDIBG7f^6?cXLk z2%9=poAUXBIJ3UPfusZs(G<~JcAH}bv1*_4S6Y=C^&#w4F^~qQNT%+6K`A$P5h4N| zzegQ8gq7jjbG%`8806Q#sib{QTRZ#TMY5~uIBN8oDNj`fTX=74dX;lf`Y&c@5)m(&vGYhMIw$ewU z6ch!neu;k0myk2h&Inx*1Hfbe-Hmg!f2$MCo>nG~Z;vS?Hzkl?W^(W|M9K`K2wz27 zgt<`_T0PD|Tb;)0K*(=# zhkOhTKk{2)zG8pj+&2>qlbHgfH)1Oj>%lI}?MX#?t7FKcQN(`Z>+C{U{h8lE<|;Zvn{8G%UUdc2XX6E^Tyb{0 z36vi>lthwESdlzq?R4xon2B#HH^r%|;2-in4KgoUtVOXk1xvXuLvz^u9Tr74DFVsa z%cd#swKgyq;Wc*XsiG@ImP(tILwv={AUz_f`3CypJm)O3GYk+}j0syDXejgDRU^4D zxXi!?D<5LDpn4=L53cF=C?RteG+oQC@O06hqLSnGT*>OwyJCz>64k%THkEhK^4nMq6r&5*HO1j3iN5sIJy^rci!GB~)D?cD;AnyIaYg!yxFf0n(oKs z_e=F(sTc;Lw}U63P=`~Uruaq$CYg^KaBUNW9JyMk#VnClL>X8kJV3NBDrTdKg{Yh9 zVyKY$Q8MQspCoE7&WALEfgw0(=W>CR7^>$4Qf|P8@Vc+Qf+FC}O!>V%G;LMJGMhyW z`n>f_P>URTezbSw&LOvPC=@hBu*c9;%vP8=A>?oRb~%$91_p?&B!qHZ6ojdQ#&`sV#7OwJZ~^nJp;Dm!1QEwq-X@64|0CA;K85a81Pi(|;VwVaz8S^wz}iI<;MuG9?fha9+HC z40Q}GTr|E=Mr4aa#p04)Iq*yJE=Cd~LAFokfhJ(XSlT7pVy#r`-bb?|c3Od1#4GVM zU)MSK$tv33vAvNL_@#O?#znd|>|A3Sbjn=FCr1+0Z5 z@1rFF_s79A7i9$P*q0bFAs!1r?rZ!+JT%5$v4{3EKhE<=DAE&o>}$B8uiPWxp5Wnu zTi!6m$VZ2iM9(AyLRoQanrJh(e#Tq4_MvW_bB%&1Xi%bjjt)RMz{+{tisB+*x2#Cd zMmtVvR=zFhPjw^Dtfu~@Ks%`Zd^pjjbrBbCI-mNnb(U2sETKr6rnzaUEo?jVy}`*q z0o0~u2??Y6}HH`VTW z*Y;ijF8~SoEvr+e7@YUhg6~6;C3;KuK}gnC5jTFH#AjRODm`h{rkQD)X0rOn`B_Yf zVi7~O#Hn2MOoe7zB|G}o$S=*lP<%Zvit3H=+v#js-EcL-Eaj)7YN+t~ps9&1ana|* z<=C+vWA;Y(2njLWL1=y&g}E@12nlA}x#$Y_A!xvBd&&M^pKOqx!P zlqhYKAKcYNbUkJtVFy-ZIU3q-zoeem)HwFI^$A;b5ef_*)q>TgLZwn#Nm^@-S* z0`a1R#p+R`@}mI+o$;ol(+Sy>*k9Qj#nf|^kRpxYNo-kD?6Tj6eo)LoId z@naLvz}%A2zrz>i)NXEyQoGkBbs0@4h{?+hqlC3Ek|oavh@#FmPLuEXlPNfSF18Wm zo{v7bb>XtP%lMj)%FBinfFyspmu1eL0+cWTNGoK=V+MGC!M#6cF-hBt+;dI4YL|)+ zv%MJ_R}?X-KIb*r8W?Ey4Z^Q&j_aDvjCvE_I~>=4HN+TgvE0atC0T4^hzho0#;XD!#&9= z@~HcG2*_kXX@V3`@~K7-?hFyZk@%_i z(wF+e*GciM^g=2~T`NF~!{|v`d0*?9>5_e()mAAJy&hl3uL=xS=Bo?jP~a3LGG~$l z`4uGO$^vC9CliaclJ#ynPl2R?R4c9GWPN*Wmxu%Mn9HYYnMRjyNfo$^sW=(#sH1U^ zbas3{o0eF0p!hP{l}ic{p!vIM(ElWR71~MpQ!vA4f$E2~yT)U5l1=@c$Kd6OwsAB2 z1RA>WRIC@k6e*gxW9u9Ta@6deS#apSz-CpiNSy;Jyea}}_V2rQk^umyq)FnYILwkG zQ)kfH*%}?*Oa_J9lsL|JlhSkc!!CmrtO%YucYVNt#gn-dy7(~{K8fcKre#LX%0@`k z^9YJI9xj%n^Qo`JM%g~7;!^u;70u=~Tt<6G=~-#SA8I~Qgfo49wKU>me*jktJ0mN* zyBM9Yh>n@Os13yl49V6bjW6f=<`%+3L!QmW&AOVMsGh{nlqmxz+{*7Y;G`3nztD1Z+~KfK2za{3}Vav|pVFv{aE-MTv5F_;O^) zh;!(@q2$4nYN-U81aA<=dS~DXRj5Pj<7}^U1Q8-+kf($j_SeXsRL2w(eMJ>UDuC+bL5la6vK(K&OT91e zg7(H(@*8yN?7K95l6`A`2wgOdVCkF`&f8vBo^)Uj5BBt(+F@+nX{mCO^?w0%KI3hA z5bzSvD2`rzP&57zs|z=24xAo5i1;b^*1{x(n#Fs=JrCGjeY&j1oa3u<(GixDvWf#w|bi>Et;S_+!%vu1^R+_Ke-}D-Plr-#M0MpGLf?11Y$kaq_E_C%5@OBNgWlO zAUs|u!tG0u`ns)6X6lPC*2`#GDC4U#DoEzggOcKBeJ+t1(6GR4FtB$(Bg&^mdU2EV(4%+wSaSq7kjZXG4$WW3 z5iZ#nu+F}-VlFR~YoGCOc`iJ{cS!yiFNwq6KpJO#m7bm+RfypxG*c4|$CyIt?eadA z7pFUZNN57pZ*XZy{Sh-L)~Nb~*n7aC%$H%#VVg=WcF2fVsp%{2`n$=o$ybh!evE?e zr*Bqqut-+!>q&~4EUJL?c_C(>yRoU$x&d3LhBcoR&PB1`8fMCey@ku|Y8LnD= zJ!N7U;oj*13gpT+Mjc|_P}EP*KhlHqyAYNA^w17Vu(gKpfW6X5hU@0ykE>>gWt~SR$s|;NRB2KGCM$Ru7(LjP5Lv|! zPx{IVis;5k&Ty5Tqk5wCx!ecM>!NVWnpD>{H0meHcZ-d7DGRD$w%;t>$Mp(0=|k&Y zdfAr_mkYmI>>bf3yj7_4`mk1ALP)g&ynv*CJI%}@KC-G+pzixHEflIo z$I@4YB*qC@&gQPii)yEws&vIL+5a%R_4CZgu4pRU{L>2dAa}N^qEKy>)o!B3M_dAv zUYJRj<-8KQKhwH@-TzAf{OiM8mm`8n?Pc0DC&7sA4}mGdh|0Lf>1gTt(h4Y>pIc*< zX>yM|_6dImNnd=s_hx+yI&i-2A zJV;~?bYCW)xHhTPRn$6_D;B9C_5RHrOvX;uwR7kMPb)ZO{Jlaz=>+j$qvJXwdTjVi zgHA9N(FERMEr(WNnG;4^QwlTe@cVVtDoq*@TkPno`6yT2`l>m_iq_>?%Ot)2AiUmM z>QG5rIE0{`>r)vzy(>!b0~;kWa+xXWIhw}$pcPq@7&Fs$3joe5fH$nbhQ?hKbz{>- zcsQuCVw$nZym@U420I=$00%(yIQRYBEW7iWthP0SCc61syyDN|Uegg_r-bM%C>FHo zENnS=gLlvzpSAm2-L&NJ0&-aYN_M`$ZeH|FazHd=U{a$`#ym-as|?mqG~`L7yPU6CO@8Z zT&6;qru=eQ()E%9GCGTsAkoz{I|jpiIQdd+3|3il&2AG(4|tW)GcL1U6^ zYM)h6#HsEtp0zzKY~1os)p4GHSb;17^vQU=t1(f!l1xM0C%7DIMnpGJ4v8nR~V4>%4My7yvt0KB|)sp$k!}YrF(;w{P za3BL#n-vDjtFV$-5!5lb{-_~F2nrjEh4oVvEVv8>tA`<8#GcJ5dUnJ7rlCsSn98(Z ze6$Q~N;fVuQ{l2Ha2is0-8wc;DnhHO6v&I6v%7|H#*~z0!)a0@B&8m|Ir}T?G=Ag} zUj?;ttxkSFHnnlSTTBF82Kwz7X^zXVGkeD6Cy363Yc04{@og6oP_?5oAVBMvS=@LV zvYt+i(&O#=hqjP(Lf?^EQ}TN==I2H+C7wnAj)02>WwuJytdLlIy3v(o_o>L3UF|6U z2ma{jGVF{>rTe^ZEM9YG*}}=-nBGlzkAyUn9g~CH%NHuRDlTevQ zLu=efBThHSOd~T;FCkvwdVs6hMC*{4Cc6GouU6Sd$mIbad(|u55bZTSze+>ZamLgz zfzXDIl5P9^TZdY&Eaf!F7tV&`Sj+bMl>Q@KpZGE+3v|3-^d}j_mQ2-K!+QxgMjyi6 zus-f!oGxlfR~0;JMn|XMbBL>f%CAuD`My|W{foqg+&5bj@$E~i`4ls{heF9Iw=?)`I?#A({(MO` zK?{tG1k^G=?X-KOy9quFm$4k8tPzli-@w69$P+)G76HwhGsZZ+C68o|7X_i5@!{!2 z0&4E=VnLN|f=DsOMtZ*oJKU73Iy-O61Pn@VQ|oK>Q9vdQstJ^td6r!hbUkPBN`As+ zJdrGj=U-bT9;bCAsz=D$>VLNT?pcw2j~N|z$_g+gHK_)A0auxqHQA^Lv_{BEl~s{S zI*Si-H*}k3D?xUq;HI`F;Ie2FZelIN6AWMBQ~TAap*6v$ry~0a-ciBZQ%LkpKi{Le zH65&tU`rH9Xx6Zo-M-#w;yZ>OAyRBji%Z06M^nzDhH1hfIsIYMfe0rO6^e>jii*H*7xpd?kZ@p4XauxxmZrfGDF>{9*RmB!l~S{u!@XiWh0 zjlL!Dz#s2HpB(&{aNzU-8n#{CPS9QT(>zR^Bf4C9Urlgh;KIpv}5Ha!sIZ0=`dF=I&{FlTEndr^GiVM_%Mlw$T!MyUP+3 zdX=Jq6~Kn*l3@g+PWJ;X;RqPwG3G;dGrh*UmLcCYF;@$ey%9V(2i^)ol3Q)}oEVY# zkFPAaRU-jate_r9W7Buxj>nWW7XtnVKmPs5#2K|&rs%@)$0IDhJ!J+BD8QvhZk>q> zBgEVAu}g?;Wi);wjvH@KoBe5X{j$Vl&JEeY;3wm8eoNB%Xib&-W5&*$03GaVeUZPN z`<=!@1G`?k$8chm`$WmOqGpyAZQ5>@Oo}GIg*(%zpB&fl|7Z!xzqDk8#^LyxBvoeG z6|#`|nV0d`LH7ov>EltwnR;O97vlQ*mId3b4j`ZH-Fez-00}`N|Cw0l9rxS>=uqTs zup#&tS3T!CoCj$GfpNS7xqLB+^a@DL<$yk)>YF~Ax*g{)F{?Yo5&IW_paqG4+i~2N zZ&EqdHHSqX3S%$>%V@Jnk7>yIo)F8XF^eXupE}bg~y|zfCkgk+Jl z$Ms+zN9UbX(#JUvp#_E?PbNjXl`a6uOFo;Vrn(cnT5e~jDnt_IJj_}G#Z=mY>IgE) z0V$6VgSN6pO-n6061AtZ5F?GEuVBlrdC+M`6?NS#q3`7wm7Y>)58z|+Ev z^)ue$%8>nX$JZODvcDu*k7)NWt*2DOwq^ zhI#k?LvU>4&490_Rnh9Q)p_3G9l>qQgjLZx%4a!A=`bm~gzy99nHG~D)j+iL7XZ5T zly!Yd3ec{VeMO2IViwUa=U6h=aI+2a${l2J7BCMlwN4Ofb_?wrwREqQZX&wA6X^kh zpMsfyJZUc0wTeDIZp>8;>ihH!gy-4cpVgZXv`VXs0~8B4Z*rUCk;ZhDPxY2~w_EycVx|l2oD#AuUIR;oy#AlHmO#7@ zCfpBSZMWgblxzxGE|dyv3Kc!L2yAwB1{{a&7LC)YK8c=Gjw)Ms$x_wLwMLC9;yT;9 zIIzJq^{Zb<3+_YfM|(7;DdgLO29I_j&H*$1kbA%0!6(08{D1?l*EzGE8V9nbpSqw%&jFGDhc!LV(dNqRx~-i%J#? zUF@3gT=&)SFi`QVq!^U+l;>qOUpmQdlNQA?Hr~YWoir&x2|;7pwYKO$K_t_spuNlw z8-qHv`c2)}Fw_7gkE$adOo5pi?13>WCj@X??_{&MQ)BOr<1ZylkuWG8cQdkVIjxP< z+&G(?A{F>Ld9n8u|9Sg$gvXi$e^)0o2(b$TL~bg79O2JDlTAI(I0kMk;CrYpeO8Q08PIc@2XAD}b6>to z?~rL~YHHVQgkJHUQ|ii*ObesOk&kwvO^~vwfB7B?WHvR{H_X_ZWvvE{5h?>Yyv^JX zmBV`kR_335b@XStKMs<8qAVVly*cpKR4B84{*t`)K4q`Vo|usi&vwTywpdAw$$60w z{wH4nba9pIB~~C=C6$(4MV|K8c!Y?DL^Ix;E}{uAzPQV`nL1`o)q0;OG_7TN3>;z7RFBhF2A=PahrNtf!+pLJ`KFC9`t`T4@AB$edXetR zs+{c?+rH|6?G&O1?>laI0sJ!V)4mKHzY%@i=#f{-X^3J&BRPni+$ z9o8|clF18;=%R(T#UskPfBx5@ff-c&>HLulTM2*``&8_C6v=*x|c@9n}>)00{CXhAPrxma2f6zss z0b>K&o7VgqE3m>-RkS@zm$$r3LviSzy^v9{zHL|tIXlu{%CSZ=?JBf9i7el)l!?FY z!K;zS!ng`Rlp&??RxnO$UQ2!Y4z%%FbAT}89G`8QZ%MDUULR{GPu@>&ttn)3%rASM ziS!ub)g|^ihxW@Y`vhi~Hyx301VPIM*mD2-D?a}v6a8mt44(PfX^Iq4C$^)xXg4I{zbg;-9Tz{pWH}ye$1+@62*Z literal 0 HcmV?d00001 diff --git a/docs/night2/reviews/critic.md b/docs/night2/reviews/critic.md new file mode 100644 index 0000000..cc13d44 --- /dev/null +++ b/docs/night2/reviews/critic.md @@ -0,0 +1,171 @@ +# 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.ts` uses `generator=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.tsx` hides the mining panel when `isNativeApp()`, 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. +1. "Does Classic and ranked PvP require 100% owned mined cards? (Recommend: yes.)" +2. "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.)" +3. "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.)" +4. "Can your 12 cards be used as public bot and ghost decks? (They're your wallet.)" +5. "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:** +1. **Invite-by-link casual PvP** first, made prominent on the Play screen. Eric can test it with a second account on testnet. +2. **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. +3. The **queue backfills with a bot after 30 s**, *labelled as a bot*. Never pass a bot off as a human. +4. 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_me` on Gitea MCP on every machine + - `node:24-alpine` is the only test image + - all heavy work runs under `flock` on inspiron + - no stacked PRs: rebase-and-merge, or wait for the parent to merge +- **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: + +1. **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. +2. **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. +3. **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. +4. **Solemn subjects get a `solemn` flag.** 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"). +5. **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. +6. **Living people (BLP):** the flavour text is the extract sentence only, and the recap uses only the card title. Any `Living people` card 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. +7. **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. +8. **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. +9. **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. +10. **Red-team fixture plus a sign-off gate.** `tests/fixtures/sensitive-cards.json` holds 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 +1. The plan never says **who decides the production UA**. REPORT next step 8 leaves it to Eric. Ship the default as `WikiDeck/ (node: ; operator contact required)`, refuse to start the enrichment client without a contact configured, and leave production config to Eric. +2. 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. +3. 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:** +1. The throttled Wikimedia client and cache. Nothing else calls Wikipedia. +2. Card derivation (type, faction, P/T, cost, keyword) with safety rules and the red-team test. +3. The smallest MTG core engine plus bots. +4. A 360 px match UI. +5. Invite-link PvP and ghost or bot matches. +6. The match log and battle recap. +7. 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) +1. Real-cards strictness (S1 questions 1–3). +2. Use of his 12 cards as public bot and ghost decks. +3. A mobile path to owning cards. +4. Keep Edit War as a mode? (Recommend: yes.) +5. Sign-off on the safety rules in S6, especially solemn Events and living persons. +6. Production User-Agent and contact. +7. Are shareable recaps public by default? (Recommend: opt-in.) diff --git a/docs/night2/reviews/data.md b/docs/night2/reviews/data.md new file mode 100644 index 0000000..8b21179 --- /dev/null +++ b/docs/night2/reviews/data.md @@ -0,0 +1,272 @@ +# Night 2 plan review: data analyst + +Inputs: `docs/game/card-sample.json` (236 random illustrated cards), `starter-cards.json`, `shared/enrichment.ts`, `shared/testnet.ts`, `server/{wiki,enrichment,wikimedia-user-agent}.ts`, `server/testnet/{http,miner}.ts`. +Scripts (all `python3 -I`, offline, no API calls): `night2/analysis/types.py`, `stats.py`, `fields.py`, `connected.py`. +**Caveat:** the type rules were tuned on this same sample, so the in-sample accuracy is optimistic. Anything marked *(memory)* comes from my knowledge of the Wikimedia APIs, not from a live check, because we are rate-limited. + +## 1. Typing (P31, then categories, then description, then a residual) + +The classifier in `analysis/types.py` checks the rules in **priority order**. The first rule that matches *any* P31 label wins. If nothing matches, it tries non-stub category titles, then the description. If all three fail, the card becomes **Doctrine**, which is the residual "idea" class and is deterministic, never hash-random. + +| Type | n | share | Mostly | +|---|---|---|---| +| Figure | 86 | 36.4% | human 64, taxon 16, breed, deity, stock character, family | +| Location | 78 | 33.1% | villages, communes, rivers, buildings, parks, roads | +| Institution | 32 | 13.6% | companies, bands, films, parties, aircraft, ships, awards | +| Event | 21 | 8.9% | elections, protests, storms, matches, team seasons | +| Doctrine | 19 | 8.1% | genes, diseases, maths, cuisine, lists, etymology | + +| Decided by | n | share | +|---|---|---| +| P31 | 222 | 94.1% | +| category fallback | 12 | 5.1% | +| description fallback | 2 | 0.8% | +| residual (Doctrine) | 0 | 0% | + +- **Unclassified rate:** 0% in-sample, down from 14% ("Other") under Night 1's faction rules. 13 cards have no P31, and one card's P31 matched no rule. +- **Accuracy:** I judge about 8 of 236 (about 3–4%) to be debatable or wrong. +- **Expected out of sample:** about 5–10% would reach the category or residual steps on regex alone. That is why the P279 step below matters. + +**Hard or misclassified examples:** + +| # | Card | P31 | Result | Problem | +|---|---|---|---|---| +| 1 | Buky, Lunugala, Ε½iΕΎki, Laukhella | human settlement | Location | **Existing bug:** Night 1's `\bhuman\b` faction rule puts these 4 villages in *People*. Use `^human$`. | +| 2 | Lewis and Elizabeth Bolton House | single-family detached home | Location | Night 1 calls it *Works* because the label contains "single". Substring rules bite. | +| 3 | Corruption in Kazakhstan | aspect in a geographic region | Doctrine | "region" pulls it to Location unless an "aspect of/in" rule runs first. | +| 4 | 2023 Seville municipal election | municipal election | Event | "municipal" pulls it to Location unless Event outranks Location. Rule order is load-bearing. | +| 5 | Agda (programming language) | functional PL; free software | Institution | Several P31 labels disagree (Doctrine vs product). Tie-breaking is by type priority, not by label order. | +| 6 | Diocese of Mindelo | Diocese of the Catholic Church | Location | "church" matches. It is really an organisation (Institution). | +| 7 | Region Γ–stergΓΆtland | county council of Sweden | Location | A governing body, so Institution. "county" matches first. | +| 8 | Christianity in the 5th century | events in a specific year or time period | Event | A history overview. Doctrine fits better. | +| 9 | NRHP listings in Yates County | Wikimedia list article | Doctrine | A list is not a thing. Consider a neutral "Index" type or rerolling at mint (consensus says no). | +| 10 | Dojikko; Tracheal collapse | stock character; type of animal disease | Figure; Doctrine | A trope as a Figure is fun but debatable. The disease was a Figure until "animal" was removed from the Figure rule. | +| 11 | Figueiredo (GuimarΓ£es) | former freguesia of Portugal | Location (via category) | Local admin-unit names defeat English regexes. Only the categories rescued it. | +| 12 | *(memory)* Rosetta Stone (stele), Apollo 11 (crewed spaceflight), ISS (space station) | | residual, residual, Institution | Famous starter cards fall through, or hit "station" and become a Location, unless explicit rules come first. | + +**Proposed rules** (as implemented in `analysis/types.py`): +1. **Doctrine overrides first:** `aspect of|in`, `disease`, `clinical sign`, `list article`, `chemical entity`. +2. **Event:** `election`, `protest`, `battle`, `war`, `storm`, `match`, `final`, `season`, `race`, `grand prix`, `scandal`, `annexation`, `time period`, `delegation`. +3. **Institution overrides:** artificial satellites, space stations and space probes. +4. **Location:** settlement and administrative-unit words, geography, celestial bodies, `civilization`, `empire`, `historical country`, built structures. +5. **Figure:** `^human$`, `taxon`, `species`, `genus`, `breed`, `deity`, `character`, `^family$`. +6. **Institution:** organisations, companies, teams, creative works, vehicles, positions, awards, typefaces. +7. **Doctrine:** concepts, theories, genes, languages, cuisine, genre, form, process, `type of`, `class of`. + +**Production recommendation** (the regex rules above are the fallback): +- Resolve each P31 class through **P279 (subclass of), up to 4 hops**, against a curated table of about 200 anchor classes. For example: Q5 β†’ Figure, Q16521 β†’ Figure, Q486972 (human settlement) β†’ Location, Q1656682 (event) β†’ Event, Q43229 (organisation) β†’ Institution, Q17537576 (creative work) β†’ Institution, Q151885 (concept) β†’ Doctrine. +- **Class cache:** the sample has only **141 distinct P31 classes in 236 cards**. Class lookups saturate quickly, cost under 0.1 requests per card amortised, and are cached forever. +- **Fallback chain:** P279 anchors β†’ label regex β†’ category regex β†’ description regex β†’ **Doctrine**. +- **Freeze the result per card:** store it in the card profile (Β§3) so that a later Wikidata edit cannot retype a card someone owns. + +**Deck consequence:** Event and Doctrine are scarce. + +| Type | P(none in 10 random cards) | P(none in 7) | +|---|---|---| +| Event | 39% | 52% | +| Doctrine | 43% | 55% | +| Institution | 23% | 36% | +| Location | 1.8% | 6% | +| Figure | 1.1% | 4% | + +- **Instants and enchantments:** a deck built from random mints often has none. The core loop must not need them. +- **Resources:** this argues for a fixed per-turn income (as plan C says). With Locations as the only resource, about 6% of 7-card decks would have no resource at all. + +## 2. Stats: percentiles β†’ cost, power, toughness (`analysis/stats.py`) + +**Facts that drive the design:** +- **No independent signal in the raw fields.** pageBytes, languageCount and monthly views are monotonic in depth, reach and attention, so their percentiles are identical. They add nothing beyond the three scores. +- **attention and depth correlate** (ρ 0.61), and **reach is independent** of both. +- **trendPercent is live, small and noisy.** Only 2.1% of cards pass the Night 1 gate (+25% and β‰₯20 views a day). +- **A new independent-ish signal** is available from the on-chain `months[]`: the volatility (coefficient of variation) of the 6 monthly views, median 0.22. Its ρ is βˆ’0.52 with attention, βˆ’0.30 with depth and βˆ’0.19 with reach. It could drive a "Volatile" keyword. + +**Proposal:** +1. `pct_s` for attention, depth and reach, using the Β§1.1 counting against the sample's 99 cut points (unchanged from Night 1). +2. `fame` = the mean of the three percentiles. Cost = 1–6, using the v1.1 `costThresholds` [26, 39, 51, 63, 78] (unchanged). +3. **The body budget depends on cost only:** P+T = [3, 4, 6, 8, 10, 12] for costs 1–6, which is MTG's vanilla curve (2/1, 2/2, 3/3, 4/4, 5/5, 6/6). +4. **The shape comes from the stats:** power = round(budget Γ— pct_a / (pct_a + pct_d)), clamped to [1, budgetβˆ’1], and toughness is the remainder. Attention reads as "loud", depth as "sturdy". +5. **Reach gives a keyword, paid for from the body.** + - **pct_r β‰₯ 75 β†’ Multilingual** (evasion-like), costing βˆ’1 from the budget. + - **reach = 0 β†’ Local** (a conditional bonus with a same-country Location, no tax). + - Local covers the 18% of cards with reach 0. +6. **Non-Figures use the same budget as effect size:** + - **Event:** deals ⌈budget/2βŒ‰. + - **Location:** P=0 with T=budget, or a per-turn bonus. + - **Doctrine:** Β±1 effects, scaled by cost. + - **Institution:** a utility ability. +7. **Trend:** Β±1 power, in Trending mode only, using live data frozen at match start. + +**Resulting distribution (236 cards, every card rated as if it had a body):** + +| cost | 1 | 2 | 3 | 4 | 5 | 6 | +|---|---|---|---|---|---|---| +| cards | 30 (13%) | 48 (20%) | 51 (22%) | 48 (20%) | 35 (15%) | 24 (10%) | +| most common P/T | 2/1, 1/2 | 1/3, 3/1, 2/2 | 3/3, 4/2, 2/4, 5/1 | 3/5, 4/4, 5/3 | 5/5, 4/5, 5/4 | 6/5, 6/6, 5/6 | + +| Measure | Value | +|---|---| +| power, 1..7 | 38 / 43 / 53 / 33 / 42 / 26 / 1 | +| toughness, 1..7 | 43 / 43 / 50 / 30 / 53 / 16 / 1 | +| keywords | none 139, Multilingual 55, Local 42 | + +**"Famous isn't strictly better" check:** +- **Strict dominance** means another card with cost ≀, power β‰₯ and toughness β‰₯, and strictly better in at least one. + - **Proposal:** 0 of 55,460 ordered pairs among cards with the same keyword. All 945 raw pairs are cases where a keyword costs one point of body, which is intended. + - **Straw man:** with P and T taken directly from the attention and depth tiers and cost derived from their sum, **3,058 pairs**. +- **Efficiency, (P+T)/cost by fame quintile:** Q1 2.64 (the cheap 2/1s), then Q2–Q5 at 1.90, 1.96, 1.95 and 1.89. +- **Famous cards are bigger and pricier, never more efficient.** Pallas's cat (fame 98) is a cost-6 6/5 Multilingual. Dr. John L. Butler House (fame 8) is a cost-1 1/2 Local. +- **Remaining risk:** in a small-deck game with fixed income, a 6-drop can still dominate the late game. Balance that in the simulator (Night 1's `scripts/sim/`), not in derivation. + +## 3. Rules-text inputs (`analysis/fields.py`) + +| Field | Where | Reliability (sample) | Use for abilities | Extra cost | +|---|---|---|---|---| +| title, extract (≀900 chars), image, legacy category, pageId, revisionId | **on-chain** (`Article`) | 100%. Extract β‰₯40 chars by filter. | Flavour text is the first sentence of the extract. Years and "(born …)" can be parsed from the extract. | 0 | +| pageBytes, languageCount, 6 months of views, dailyAverage, trendPercent, attention/depth/reach | **on-chain** (`MintStatsSnapshot`) | 100% (attention null under 1%) | Cost and body, Multilingual/Local, Volatile, Rising/Fading | 0 | +| description (short) | live: WP `prop=description` | 90% | Keywords such as "Species of", "Village in", "film by" | in the batched meta query | +| non-hidden categories | live: WP `prop=categories` | 100%, median 5 | Year in 55% of cards; births/deaths 25%; establishments 10%; stub 34%; country words 52% | same query | +| wikidataId | live: `pageprops` | 100% | Key for all Wikidata data | same query | +| P31 (instance of) | live: Wikidata | 94% | **Type** | 1 per 50 cards | +| Dates: P569/P570 birth and death, P571 inception, P585/P580 point in time and start | live: Wikidata | *(memory)* Common for humans, organisations and events; rare for taxa and concepts | Era keywords ("Ancient", "19th-c."), "Contemporary" links | same `wbgetentities` | +| Coordinates: P625, or WP `prop=coordinates` | live | *(memory)* Nearly all Locations, few others | "Adjacent" (distance), hemisphere, lat/long flavour | in the batched meta query | +| Country: P17 / P27 | live | *(memory)* Most places, people and organisations | "Compatriot" connection | same `wbgetentities` | +| Outlinks: `prop=links` | live | 100% | Connected (Β§4) | 1–6 per card, continuation | + +**Request cost per card, first sight, cached forever:** +- **Batched, amortised:** about 1.5 requests per card. + - 1/50 for the WP meta query (description, categories, pageprops, coordinates) + - 1/50 for `wbgetentities&props=claims` + - under 0.1 for class/P279 lookups + - about 1.2 for outlinks +- **Unbatched (a single card at a time):** about 4 requests. +- **Payload warning *(memory)*:** `props=claims` for famous items can be **hundreds of KB to over 1 MB** (Q76, Barack Obama). It cannot filter by property. + - **Option 1:** a WDQS SPARQL `VALUES` query for the ~12 needed properties, covering up to about 100 items per query. + - **Option 2:** accept the size and only ever fetch each item once. + +**Request cost per match**, two decks of 10 cards: +- **Warm caches:** **0–1**. That is the links matrix (Β§4) if per-card outlinks aren't cached. +- **Trending mode:** add up to **20 per-article pageview requests** for today's figures. These can't be batched, so refresh them in a daily background job, never at match start. +- **Cold worst case:** about 23 requests, which is 23 s at 1 request per second. So prefetch when a card is minted or received, or when a deck is saved, never at queue time. + +**Frozen vs live:** +- **On-chain (frozen by consensus):** only `article` and `statsSnapshot`. +- **Everything else is mutable.** That covers type, dates, country, categories and links. + - **Card profile:** freeze it once into an off-chain record, `{tokenId, pageId, mintRevisionId, fetchedRevisionId, wikidataRev, type, faction, dates, country, coords, outlinks hash}`. Cache it forever, and log it in the match record so replays and recaps are deterministic. + - **Why not the mint revision:** fetching categories or links *as of* the mint revision needs `action=parse&oldid=`, which is costly because of the parser-cache miss *(memory)*. Freeze at first sight instead, and record which revision was used. + - **Agreement between hosts:** different hosts could freeze different profiles. To fix that, a node publishes its signed profile file per tokenId, and hosts adopt the first one seen. + +## 4. Connected: cheap relationship detection (`analysis/connected.py`) + +**Measured on random pairs** (27,730 pairs): + +| Relation | Pairs | In a 10-card deck (β‰₯1 pair) | +|---|---|---| +| any shared category (including generic ones such as "Living people" or "1948 births") | 1.96% | | +| shared **specific** category | **0.04%** | 2% | +| same P31 class | 7.9% (mostly human/taxon) | | +| same P31, excluding human and taxon | 0.22% | | +| same country (text proxy for P17/P27) | 7.4% | 91% | +| same century (text proxy for dates) | 16.6% | | +| country OR century OR specific category | 21.5% | 99% | + +**Direct article links between two random cards will almost never fire.** +- Shared specific categories are already 0.04%, and links are rarer still between random stubs. +- Obama ↔ White House only works because both are famous starter-style titles. +- **Proposed tiers:** + - **Linked (rare, strong):** a direct link in either direction. + - **Compatriot:** same P17 or P27. + - **Contemporary:** same century, from P569, P571 or P585. + - **Kin:** same P31, excluding human and taxon. + +**Methods compared:** + +| Method | Cost | Notes | +|---|---|---| +| Pairwise links matrix: `action=query&titles=A1…An&prop=links&pltitles=A1…An&pllimit=max` | **1 request per match** for up to 50 titles; at most 400 edges for 20 cards, under the 500 limit | Gives both directions for every pair. Uses current revisions. Misses links that go through redirects, unless you add `redirects` and also check the redirect titles. | +| Per-card outlinks (`prop=links`, ns0), cached | 1–6 requests per card, once | Intersection is local and free, so it scales to the whole chain. Network-wide this is at most 96 Γ— about 2 β‰ˆ 200 requests a day. **Recommended.** | +| `prop=linkshere` (backlinks) | Famous pages: thousands to millions, many continuations | **Avoid.** Outlinks from both sides already cover A↔B. | +| Shared Wikidata values (P17, P27, P131, P106, P101, P361, dates) | Included in the card profile fetch | Most useful in practice. Gives readable reasons ("both Polish"). | +| Categories | Included in the meta fetch | Too sparse except for generic categories, which are meaningless. Use only for era and country when Wikidata lacks them. | + +**Caching:** +- **On first use:** compute each card's outlinks and profile once, keyed by `(pageId, fetchedRevisionId)`, and pin them to the `tokenId` forever. +- **During a match:** the host computes the edge list at match start from cached profiles, which needs no requests, and writes it into the match log. +- **Re-fetching:** never re-fetch for an owned card. An optional "re-sync" can be a deliberate, logged action. + +## 5. Wikimedia politeness *(memory: not checked live tonight)* + +**Rules:** +- **User-Agent policy:** + - The policy asks for a descriptive UA with contact details: `Tool/version (https://site; contact@…) lib/ver`. + - Generic or library-default UAs may be throttled or blocked. Browsers must use `Api-User-Agent`. + - **Finding:** our defaults have **no contact at all**. That covers `Wikideck/0.1 (experimental Wikipedia article cards)`, the enrichment UA, and the sampler UA `WikiDeckCardDataSampler/0.1`. Contact is opt-in only, through `WIKIDECK_USER_AGENT`. This is likely part of why the shared IP got 429. +- **Action API etiquette:** + - Make requests **serially**, not in parallel. There is no fixed read limit, but use "reasonable" volume. + - Send `maxlag=5` on non-interactive requests, and on a `maxlag` error wait for `Retry-After`. + - Batch: `titles`/`pageids` take 50 per request (500 with the bot flag), and `pltitles` 50 likewise. + - Use continuation, `Accept-Encoding: gzip`, and `formatversion=2`. +- **REST API (`/api/rest_v1`):** the historical guidance was ≀200 requests per second per client. Since 2025 Wikimedia has tightened limits on unauthenticated automated traffic and enforces them per IP/UA. Treat any published number as a ceiling, not a target. + - **API Portal or token traffic:** I recall anonymous traffic at about 500 requests an hour and a personal token at about 5,000 an hour. **Unverified.** +- **Pageviews (AQS):** + - The documented limit was about 100 requests per second per client. + - It is **per article and has no batching**. + - Daily data lands once a day, a few hours after 00:00 UTC, so refreshing more than once a day is waste. +- **Wikidata:** + - `wbgetentities` takes up to 50 ids per request; use `props=` to slim the response. + - WDQS allows about 60 s of query time per minute and 5 concurrent queries per client, and blocks after repeated errors. +- **Always:** honour `429`/`503` with `Retry-After`, use exponential backoff, and cache. + +**Concrete node defaults:** + +| Setting | Default | +|---|---| +| Client | one shared `WikimediaClient` per **process, and budget per egress IP** (several nodes or agents behind one IP must share it) | +| Rate | token bucket: **1 request/s sustained, burst 3**, **1 in-flight per host** (en.wikipedia.org, wikimedia.org, wikidata.org) | +| Daily cap | 20,000 requests a day per node (configurable). Past it, serve from cache or 503. | +| maxlag | `maxlag=5` on every Action API call from background jobs | +| 429/503 | honour `Retry-After`, else 5 s Γ— 2ⁿ up to 15 min. **Circuit breaker:** after 3 consecutive 429s, stop all Wikimedia calls for 10 min. | +| Batching | 50 pageids/titles, 50 Wikidata ids, links matrix per match | +| UA | `WikiDeck-node/ (+https://; )`. **Start-up warns loudly**, or refuses in prod, unless a contact is set. | +| Cache | on disk. Profiles and outlinks are immutable (keyed by tokenId and revision). Pageviews keyed by (title, day). ETag / `If-None-Match` on REST. | +| Background | one daily job after about 06:00 UTC refreshes live views for cards in active decks only | + +**Mining load: a real issue the plan doesn't list.** +- **What a template costs:** `POST /api/mining/template` calls `wikipediaArticles.random()`, plus `getFresh()` enrichment, on **every template**. That is 3 or more Wikimedia requests (`server/testnet/http.ts:122`). +- **How often:** each miner asks for a new template whenever the tip changes (`server/testnet/miner.ts:89`). +- **Load:** M miners make **about 3M requests per block, all in a burst at each new tip**, or 288Β·M a day. With 100 miners that is 28,800 a day, which breaks the cap above. +- **Fix:** prefetch a small pool of article+snapshot pairs in the background at 1 request/s, and serve each template from the pool. + - `grnlimit=10` yields about 4.4 usable articles per request. + - This changes no consensus rules. + - Wikimedia load then stays at about 2–3 requests per block, whatever the number of miners. + +## 6. Supply + +- **Production:** at most 96 blocks a day means at most 96 cards a day: 672 a week, about 2,900 a month, 35k a year. +- **Mainnet reality:** 12 cards, all mined on 2026-11-01. That is **0.75 a day averaged over 16 days**; mining has effectively stopped. +- **Model:** with M equal-hashrate miners, each expects 96/M cards a day, so the time to N cards = **NΒ·M/96 days**. This assumes continuous full block production. + +| Active miners M | N=7 | N=10 | N=20 | N=40 | N=60 | +|---|---|---|---|---|---| +| 1 | 1.8 h | 2.5 h | 5 h | 10 h | 15 h | +| 10 | 0.7 d | 1.0 d | 2.1 d | 4.2 d | 6.3 d | +| 50 | 3.6 d | 5.2 d | 10 d | 21 d | 31 d | +| 100 | 7.3 d | 10 d | 21 d | 42 d | 63 d | +| 500 | 36 d | 52 d | 104 d | 208 d | 313 d | + +**Caveats:** +- **Mining is a Poisson lottery.** At M=100, 10 cards take a mean of 10.4 days, but about 15 days at the 90th percentile. +- **Hashrate is skewed.** The *median* miner gets well under 96/M; a phone-class CPU gets about 0. Non-miners only get cards through trades. + +**Implications for deck size:** +- **Rule of thumb:** a deck size D is reachable in T days only if D ≀ 96Β·T/M. + - For a 1-week ramp with 100 miners, D ≀ 6.7. + - **40–60-card constructed decks** need M ≀ about 12, or months of play. +- **Recommendation: a 7–10-card constructed deck**, plan option (a). + - Every card is unique anyway, so this is effectively Highlander, with recursion and reuse. + - **Collection-as-deck**, option (d), covers players with fewer than 7 cards. +- **Draft, option (c), is supply-friendly**, but only once the chain holds enough cards. + - An 8-player draft of 3Γ—15 needs 360 cards (about 4 days of full production); a 2-player draft needs about 60. + - **Today's 12 cards cannot feed even one draft.** +- **The cold start is the blocker, not the steady state.** Eric must decide one of two things for launch week: + - accept a loaner or shared pool (plan option (b), which conflicts with requirement 1), or + - accept that PvP only works after someone mines continuously for a day or two. diff --git a/docs/night2/reviews/designer.md b/docs/night2/reviews/designer.md new file mode 100644 index 0000000..f6eac46 --- /dev/null +++ b/docs/night2/reviews/designer.md @@ -0,0 +1,278 @@ +# Night 2 review: game designer + +**Verdict: approve the direction with changes.** Do the MTG-style duel, the article-derived types, the Connected bonus and the battle recap. The plan has one gap: it has no answer to supply, and Open problem 1 decides whether any of the rest gets played. My answer is a **15-card deck made of your owned article cards plus Basics**. Basics are non-article "process" cards, the equivalent of MTG basic lands. **Draft** from the chain's whole register is the front door for players who own few cards. Rules core: **no stack, no land cards, fixed income, attack/block with single blocks, 16 Notability.** Everything below is data in the existing rules-as-data style. + +--- + +## 1. Supply (Open problem 1) + +**The facts:** mainnet holds 12 cards, all in one wallet. At most about 96 a day can be mined, and the real rate is far lower. For months nearly every player will own 0–3 cards. No version of "real cards only" fills a 40-card deck. The question is how the rules bend. + +### Recommendation: "Collection + Basics" (options a and d, with the MTG basic-land argument) +- **Deck:** exactly **15 cards**. + - **Article slots:** any number of your owned mints, up to 15. Each mint can appear once, since it is unique. Different mints of the same `pageId` can appear up to 2 times. + - **Basics** fill the rest, at most 3 copies of each. + - Owned and loaner copies no longer mix (v1 Β§2 is retired). +- **Basics are not articles.** They are a fixed set of 8 Wikipedia process cards that nobody owns and anyone can use in any number. Listed in Β§2.4. + - **The argument for Eric:** in Magic, about 40% of every deck is basic lands that nobody collects, and the deck is still "your deck". Here, **every article in your deck is one you mined**. The letter of the requirement holds for articles. It bends only in that the deck isn't made *only* of articles. +- **Signature card:** before the match you name one owned article as your Signature. It **starts in your opening hand**, in addition to the 5 cards you draw. + - So a player with 1 card plays that card in every game. + - The recap's infobox lists it under "Commanders". +- **Small deck, high visibility:** a typical game lasts about 8 turns each, so you see 5 + 8 = 13 of your 15 cards. Your owned cards nearly always show up. +- **Running out of cards doesn't lose the game.** When your library is empty, shuffle your Deleted pile (the graveyard) into it. This is option (a)'s "recursion and reuse". +- **Power parity:** an article and a Basic of the same cost are worth about the same, with articles roughly 10% ahead from keywords and Connected (sim target: an all-Basics deck wins 42–48% against a 12-article deck). + - Owning cards buys **variety, story and a modest edge**. It doesn't decide games. Ranked Glicko absorbs the rest. + +### What a new player does +| Owns | Practice / AI | Casual PvP | Ranked | Draft | +|---|---|---|---|---| +| 0 cards | Tutorial: the Basics deck plus 3 Archive cards, the existing loaners in a grey "Not owned" frame | Basics-only deck allowed | no (one article needed) | **yes: main path** | +| 1–5 | any | Collection + Basics; the Signature guarantees their card | yes | yes, plus the owner perk | +| 6–15 | any | mostly articles | yes | yes | + +Casual matchmaking groups players by article count (0–2 / 3–7 / 8+). Ranked has one ladder. + +### Fallbacks, in order +- **Fallback A (if all-Basics games test as dull):** the "Archive ramp". + - Up to `max(0, 8 βˆ’ owned)` Archive loaner articles may fill slots, and they shrink as you own more. + - Archive cards are grey-framed and listed in the recap as "(Archive, not owned)". + - This is option (b) with a sunset clause. **Eric must accept it explicitly.** +- **Fallback B (strictest "real mints" reading):** "Register as shared library". + - Both players draw from one shared library: every mint on the chain, whoever owns it, plus Basics. + - Your owned cards sit in a Command zone. You can cast them at any time, and they return there with +1 cost tax. + - Every article in play is then a real mint, but your *deck* is no longer yours. It also needs β‰₯ 30 mints before games stop repeating. + +### What Eric must decide +1. Are Basics acceptable as a deck's "lands"? I recommend yes. +2. Archive loaners below 8 owned cards: allowed, or Basics only? I recommend Basics only at launch, with Fallback A behind a ruleset flag. +3. Can owning cards give a small edge in ranked? I recommend yes, capped by the parity target above. + +--- + +## 2. Rules core (Open problem 2) + +**Is MTG combat too complex for one night?** Not if the rules are cut to the bone: no stack, single blocks and one main phase. It is the only part that gives "feels like Magic", so keep it. The lane engine, `Topic` and `Portal` are retired. `rng.ts`, `ruleset.ts`, `modes.ts`, `validateDeck`, `replay`, `viewFor` and serialisation carry over. + +### 2.1 Setup and turn +- **Notability:** each player starts at **16** Notability (the life total). Reaching 0 loses. + - The log reads: "*X* was nominated for deletion. The result was **delete**." +- **Opening hand:** draw 5, plus your Signature. One free mulligan: shuffle, draw 5, put 1 on the bottom. +- **First player:** skips the first draw. The second player gets **Second Opinion**, a 0-cost token: "Gain 1 Citation this turn". +- **Turn:** (1) **Refresh:** Citation maximum +1 (to at most 7, plus Territory), Citations refill, permanents untap. (2) **Draw** 1. (3) **Main:** play cards in any order. (4) **Combat.** (5) **End:** damage clears, "until end of turn" effects end, hand limit 7. No second main phase. +- **Resources:** fixed income, the Hearthstone model. **No land cards, so no land screw.** + - Locations add ramp (+1 maximum each, at most +2 from Territory in total). Max Citations is 9. +- **Summoning sickness:** a Figure can't attack the turn it enters ("Pending review"). Trending removes this. + +### 2.2 Combat +- **Attack:** the active player taps any untapped Figures to attack. They attack the opponent only, not permanents. +- **Block:** the defender assigns at most one blocker to each attacker. Each blocker blocks one attacker. Locations with Garrison may block. +- **Damage:** simultaneous. Blocked pairs trade damage, and an unblocked attacker deals its power to Notability. +- No trample and no first strike in v1. That is about 150 lines of engine, and it is easy for bots. + +### 2.3 Interaction without a stack +- **There is no priority, and nothing happens at instant speed.** That is the right call for online PvP on phones, because priority passes cost latency and clock time. Events are sorcery-speed. +- **v2, cut tonight:** *Pending changes*, Events set face-down that trigger on a condition (like Hearthstone's Secrets). They add interaction on the opponent's turn without priority passes. + +### 2.4 Basics (the 8 process cards, max 3 copies each) +| Basic | Type | Cost | Text | +|---|---|---|---| +| Anonymous Editor | Figure | 1 | 1/2 | +| Established Editor | Figure | 3 | 3/3 | +| Administrator | Figure | 5 | 4/5. When this enters, destroy target Figure with power 2 or less. | +| Citation | Event | 1 | Put a +1/+1 counter on target Figure. | +| Revert | Event | 2 | Return target Figure or Doctrine with cost 3 or less to its owner's hand. | +| Talk Page | Event | 2 | Draw 2 cards, then discard 1. | +| Speedy Deletion | Event | 4 | Destroy target Figure. | +| Sandbox | Location | 1 | Territory. Garrison 0/1. | + +### 2.5 Length +- **Clock:** 60 s per turn plus a 5-minute bank per player. +- **Turn cap:** at the end of turn 12 (each player's), the player with more Notability wins. A tie goes to the higher total power on the battlefield, then to the second player. +- **Sim target:** median 7–9 turns each, 6–12 minutes, decided before the turn cap in β‰₯ 85% of games. +- **Tunable:** Notability (14–20) and the maximum Citations are ruleset keys. + +--- + +## 3. Derivation: article to card (Open problems 3 and 5) + +All of it is deterministic: no LLM, fixed tables, and a versioned `deriveVersion`. + +**Inputs:** +- the snapshot (as v1) +- `description`, `categories` and `pageBytes`, already in `PageEnrichment` +- the Wikidata entity's **claims**, fetched in the same `wbgetentities` call (≀ 50 ids per request) that Night 1 already used for P31, so no extra requests + +The host caches the claims per `(wikidataId, lastrevid)` and freezes them into the `CardInput` at deck validation. + +### 3.1 Type: the first rule that matches wins +1. **Exact Q-id table:** + - Q5 human, Q95074 fictional character, Q16521 taxon, Q23038290 fossil taxon, Q8436 family, deities β†’ **Figure** + - Q486972 human settlement β†’ **Location** +2. **P31 label regex,** reusing `factionRules`, grouped by type: + - People and Nature taxa β†’ Figure + - Places and Structures β†’ Location + - Events and Sport matches/seasons/finals β†’ Event + - Works, Organisations, Sport teams and companies β†’ Institution + - Ideas & Tech β†’ Doctrine +3. **P279 "subclass of" labels,** with the same regexes. Concepts such as *Monoid* have no P31 and only P279. This is why 13 sample cards have no P31. +4. **Description regex,** present on 90% of the sample: + - `^Species of|genus of` β†’ Figure + - `(actor|politician|player|singer|writer)\b` β†’ Figure + - `^(Commune|Village|Town|Municipality|River) in` β†’ Location + - `election|storm|battle` β†’ Event +5. **Categories:** `\d+ births|deaths|Living people` β†’ Figure, `Communes of|Villages in|Populated places` β†’ Location, `establishments` β†’ Institution, `elections|disasters|battles` β†’ Event. +6. **Otherwise Doctrine (Neutral).** An abstract thing is the safest default. + +**Bug to fix:** the People regex `\bhuman\b` matches "human settlement". As a result *Buky*, *Lunugala*, *Ε½iΕΎki* and *Laukhella* are People in the sample today (4 of 68). Run the exact Q-id step first. Then score the sample's 236 cards in CI and hand-check the 34 "Other" cards. Target β‰₯ 95% plausible. + +### 3.2 Portal (the faction or colour), orthogonal to type +Five **Portals**, each with an MTG colour analogue, plus **Neutral**: +- **Arts** (red) +- **Earth** (green) +- **History** (black) +- **Science** (blue) +- **Society** (white) + +**How a card gets one:** +- **Score:** count keyword hits in description + categories + P31/P106 labels, using fixed regex lists in data. For example: + - History: `\d+(st|nd|rd|th)-century|deaths|sultan|empire|castle|medieval` + - Science: `mathemat|algebra|programming|gene|chemi|disease|scientist` +- **Ties** go to the type default: Figure β†’ Society, Location β†’ Earth, Event β†’ History, Institution β†’ Arts, Doctrine β†’ Science. +- **Zero hits:** the card is Neutral. + +**Deck rule: none.** You can't ask for colour discipline from a 3-card collection. Portals matter only through effects, for example "Figures from your Portal get +1/+0". + +### 3.3 Cost and stats +- **Percentiles, `fame` and cost 1–6:** exactly as v1 Β§1.1–1.2, using the existing `costThresholds`. +- **Figure:** + - budget `B = 2Β·cost + 1` (3/5/7/9/11/13) + - `s = clamp(pct_att/(pct_att+pct_depth), 0.3, 0.7)` + - `power = max(1, round(BΒ·s))`, `toughness = B βˆ’ power` + - each keyword costs 1 point from the larger stat (minimum 1) + - at most 2 keywords + - fame sets cost, never efficiency: v1's anti-inflation principle is kept +- **Location:** + - cost `ceil(cost/2)` (1–3) + - Territory + - Garrison 0/T, where `T = 1 + floor(pct_depth/25)` + - can't attack +- **Event, Institution and Doctrine:** magnitude `k = ceil(cost/2)` (1–3) inside the templates in Β§3.5. + +### 3.4 Keywords, in priority order, max 2 +Rates are measured on the 236-card sample. + +| Keyword | Trigger | Rules text | Sample rate | +|---|---|---|---| +| **Protected** | category `Living people` | Can't be targeted by Events an opponent controls. | 14% | +| **Featured** (flying) | pct_attention β‰₯ 85 | Can be blocked only by Featured or Translated Figures. | ~15% | +| **Translated** (reach) | languageCount β‰₯ 20 | Can block Featured Figures. | 12% | +| **Legacy** | P570 present or a `\d+ deaths` category | When this is destroyed, draw a card. | 12% | +| **Stub** | category contains "stubs" or pageBytes < 3000 | At the start of your turn, put a +1/+1 counter on this (at most 2). | 34% | +| **Well-sourced** | pct_depth β‰₯ 85 | Prevent the first 1 damage dealt to this each turn. | ~15% | +| **Trending** (haste) | Trending mode only: live β–² | Can attack the turn it enters. | mode | + +### 3.5 Templates by type +Text is set in MTG's terse register. Subtype regexes run over the P31/P279 labels and the description. +- **Event:** + - conflict (`battle|war|siege|annexation|protest|riot`): "Deal k+1 damage to target Figure or Location." + - disaster (`storm|nor.easter|cyclone|earthquake|flood|tornado`): "Deal kβˆ’1 (min 1) damage to each Figure and each Location." + - election (`election|referendum|straw poll`): "Create k 1/1 Society Figure tokens named Elected Member." + - sport (`match|final|season|tournament`): "Target Figure you control gets +k/+0 until end of turn, then fights target Figure you don't control." + - period (`events in a specific year|ceremony|festival`): "Draw k cards." + - default: "Target Figure gets +k/+k until end of turn." +- **Institution** (a permanent, like an artifact): + - organisation/company/party/military: "At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member." (for cost β‰₯ 4; below that, "When this enters, …") + - creative work: "Figures you control that are Connected to this get +1/+1. When this enters, draw a card." + - team/club: "Figures you control with power 2 or less get +1/+0." + - vehicles and ships (v2: Crew): "Figures you control have Featured while attacking." +- **Doctrine** (an Aura, the mechanic in Eric's Tetrated dodecahedron β†’ Cho Yang-ho anecdote): + - **Adopt:** "Attach to target Figure. Adopted Figure gets +k/+k." If the Figure leaves, the Doctrine goes to Deleted. + - Riders by subtype: + - mathematics: "and has Well-sourced" + - language/software: "Whenever it deals combat damage to a player, draw a card" + - ideology/religion: "Other Figures you control from the same Portal get +1/+0" + - **Pathology** (`disease|clinical sign|gene|chemical`) is inverted: "Attach to target Figure. It gets βˆ’k/βˆ’k." +- **Flavour text:** the first sentence of the extract, or `description` if the extract is missing (the sample has none). + +### 3.6 Example cards from `card-sample.json` +Tiers and stats are taken from the file. The final numbers come from the real percentile function. + +| Card | Derivation | Generated card | +|---|---|---| +| **Tom Ewell** (person) | Q5 β†’ Figure. "actor" β†’ **Arts**. Tiers 10/9/10 β†’ fame β‰ˆ 92 β†’ cost 6. B = 13, s β‰ˆ .53 β†’ 7/6. Featured (att), Translated (30 langs), Legacy (1994 deaths) apply; capped at 2 by priority: Featured, Legacy. | **Tom Ewell**, 6, Figure β€” Arts. **6/5**. *Featured. Legacy.* "American actor (1909–1994)." *(description; extract not in sample)* | +| **Salahuddin of Aceh** (person) | Q5 β†’ Figure. "16th-century", "Sultans" β†’ **History**. 7/6/7 β†’ fame β‰ˆ 62 β†’ cost 4. B = 9 β†’ 5/4. Legacy (1548 deaths) β†’ 4/4. | **Salahuddin of Aceh**, 4, Figure β€” History. **4/4**. *Legacy.* "Sultan of Aceh (1530–1537/9)." | +| **Monoid** (maths/concept) | No P31 β†’ P279 "algebraic structure" β†’ Doctrine. "Algebraic structures", "Category theory" β†’ **Science**. 10/10/10 β†’ cost 6, k = 3. Maths rider. | **Monoid**, 6, Doctrine β€” Science. *Adopt.* Adopted Figure gets +3/+3 and has Well-sourced. "Algebraic structure with an associative operation and an identity element." | +| **Agda (programming language)** | P31 programming language β†’ Doctrine. **Science**. 10/9/9 β†’ cost 6. Language rider. | **Agda**, 6, Doctrine β€” Science. Adopted Figure gets +3/+3. Whenever it deals combat damage to a player, draw a card. | +| **Dichromorpha viridis** | Q16521 taxon β†’ Figure. "Species of grasshopper" β†’ **Earth**. 7/1/6 β†’ fame β‰ˆ 45 β†’ cost 3. B = 7, s clamped to .7 β†’ 5/2. Stub (1,347 B) β†’ 4/2. | **Dichromorpha viridis**, 3, Figure β€” Earth. **4/2**. *Stub.* "Species of grasshopper." | +| **April 2021 nor'easter** | P31 nor'easter β†’ Event, disaster. "2021 in Maine" … β†’ **Earth**. 6/10/2 β†’ cost 4, k = 2. | **April 2021 nor'easter**, 4, Event β€” Earth. Deal 1 damage to each Figure and each Location. *(kβˆ’1 = 1: the sim decides whether disasters need k instead)* | +| **1954 Gold Coast general election** | legislative election β†’ Event, election. **Society**. 7/4/5 β†’ cost 4, k = 2. | 4, Event β€” Society. Create two 1/1 Society Figure tokens named Elected Member. | +| **Pathrail Mosque** | mosque β†’ Location. "15th-century mosques" β†’ **History** (2 hits) vs Society (1). Derived cost 4 β†’ Location cost 2. pct_depth β‰ˆ 55 β†’ Garrison 0/3. | **Pathrail Mosque**, 2, Location β€” History. Territory. Garrison 0/3. | +| **Tatsunoko Production** | animation studio β†’ Institution, organisation. **Arts**. 10/10/9 β†’ cost 6. | **Tatsunoko Production**, 6, Institution β€” Arts. At the start of your turn, if you control fewer than 3 tokens, create a 1/1 Figure token named Staff Member. *(the sim may want 2/2 at cost 6)* | +| **Charmont-en-Beauce** | commune of France β†’ Location. **Earth**. 2/2/10 β†’ cost 1. Stub ignored (Locations take no keywords). | **Charmont-en-Beauce**, 1, Location β€” Earth. Territory. Garrison 0/2. | + +**Readability:** a Figure shows cost, P/T, Portal, the type line and up to 2 keyword words. The full text is behind a tap. This is still one phone-sized face. + +--- + +## 4. Story mechanics (Open problem 4, design side) + +### 4.1 Connected +- **Data:** the frozen claims (Β§3). Each card gets `qid` and `connectKeys` at derivation. The engine intersects keys without any I/O. + - Keys come from P17/P27/P131/P495 (place), P106/P101/P921/P136 (field), P361 (part of), P171 (parent taxon) and `C` (from P569/P570/P571/P580/P585). + - Century counts only between cards of **different** types, because it is too common otherwise. + - Wikipedia link tables are not used in v1, which gives zero extra requests. +- **Direct connection:** one card's claims cite the other card's `qid`, for example Barack Obama with the White House (residence). +- **Bonuses:** + - A Figure gets **+1/+1** while you control another card Connected to it; **+2/+2** if the connection is Direct. + - A Doctrine adopted by a Figure Connected to it gives its bonus twice. + - A Connected creative-work Institution buffs, as in Β§3.5. +- **The card shows why:** "Connected β€” Pathrail Mosque (country: Bangladesh)". +- **Rivalry (log only, v1):** an opposing pair that is Connected is noted in the log and the recap ("The two had previously been associated through …"). +- **Tuning:** sim on random 15-card decks from the sample. Target 0.5–2 Connected pairs per deck. Drop the noisiest keys (P17 = United States, or France) if the rate is above that. + +### 4.2 Match log +Past tense, third person, no adjectives about real people, numbered references. Card names are *italic* links, and the first mention is "the card *X*". Examples: +> Turn 3. *Tom Ewell* (American actor, 1909–1994) was deployed by eric.[1] +> Turn 4. *Monoid* was adopted by *Salahuddin of Aceh*, which became a 7/7.[2][3] +> Turn 5. The *April 2021 nor'easter* dealt 1 damage to each Figure. *Dichromorpha viridis* was destroyed.[4][5] + +There is one template per engine event type (about 25 strings). It is generated from the deterministic event list, so `replay` regenerates it exactly. + +### 4.3 Battle recap ("Battle of X (2026)") +- **Title:** + - "Battle of {Location}": the winner's highest-cost Location at the end, else any Location in play. + - With no Location: "{Signature of the winner} campaign". + - The prefix is "Skirmish at" under 6 turns and "Siege of" over 10. +- **Infobox:** date, Location, result ("Decisive victory" if the margin is β‰₯ 10, "Pyrrhic victory" if the winner has ≀ 3 Notability, "Victory by decision" at the turn cap), belligerents (players), commanders (Signatures), strength (cards deployed), casualties (cards destroyed). +- **Sections:** Background (Portals, Signatures); Course of the battle (the 3–5 largest swings); Aftermath (final Notability, rating change); See also (Connected pairs); References (every card's real article with `revisionId`, plus the mint id). +- **Branding:** Wikipedia-*style* typography, but **no Wikipedia or Wikimedia logo or name in the masthead.** Footer: "This page records a WikiDeck match. Card names refer to Wikipedia articles; the events described are game events." + +--- + +## 5. Modes in the new structure +- **Classic:** Collection + Basics, 15 cards, Signature. Ranked (Glicko-2) and casual queue, plus invite-by-link. +- **Draft (front door):** + - **Pool:** the host's **Register**, every mint on its chain whoever owns it. That means real mined cards for players with none. + - **Picks:** an open pool of 20 cards, made of min(Register, 16) random mints plus Basics. The two players snake-pick 10 each, at 20 s per pick, and the deck is their 10 picks + 5 Basics of their choice. + - **Owner perk:** if you own a mint in the pool, you may take it as your first pick, once, and the recap credits it "from the collection of X". + - **Small Register:** mainnet's 12 mints still work, padded with Basics. If the Register has fewer than 16 mints, the ruleset may allow Archive padding (Fallback A). +- **Trending:** any deck policy. Live trend frozen at match start, through the throttled client and its daily cache: + - **β–²** (trend β‰₯ +25% and daily β‰₯ 20): Trending (haste) and +1/+0 + - **β–Ό** (≀ βˆ’50%, daily β‰₯ 20): βˆ’1/βˆ’0 + - the 20/day floor keeps noise out (CARD_DATA finding 6) +- **House rules:** unchanged, data-only. New keys: `startingNotability`, `deckSize`, `maxCitations`, `turnCap`, `basicsAllowed`, `archiveRamp`, `connectedBonus`. + +## 6. Scope for tonight (designer's cut order) +**Must:** the duel engine (Β§2); derivation (Β§3.1–3.5) with the classifier test on the sample; the 8 Basics; Connected with frozen claims; the match log; the recap page; Classic + Draft through PvP lobbies; a greedy combat bot. + +**Cut first:** Rivalry text, Trending's β–Ό, Pathology inversion, Institution subtypes beyond the default. **Defer:** Pending changes, vehicles/Crew, the Archive ramp (flag only). + +## 7. Risks +1. **The engine rewrite is the night's critical path.** The lane engine, bots and golden tests don't transfer. Mitigation: freeze the Β§2 rules at 21:45, then one engine owner and one bot/sim owner from the first hour. +2. **Famous cards all cost 6** (Tom Ewell, Monoid, Agda, Tatsunoko). Collections of notable articles are top-heavy. Mitigation: the Signature in hand plus fixed income make 6-drops castable by turn 6. Watch the sim's curve. +3. **Basics games are generic.** For 0–2 card owners, Classic has little story. That is exactly why Draft is the front door, and why Fallback A exists. +4. **The classifier is wrong ~5–10% of the time** (the human-settlement bug, P279-only concepts). Show the type line with a "derived from: P31 = …" tooltip so mistakes read as data, not bugs. Correct it by `deriveVersion` bumps, never by hand. +5. **Claims are live data, not the mint snapshot.** Card text can drift between nodes. Freeze the claims per card at first sight with `claimsRevision`, and log it. The host's copy is authoritative for its matches. +6. **Real people in shareable recaps:** this is a living-persons and tone risk. Use mechanical verbs only ("was destroyed", "attacked"), use "the card X", and add no commentary. +7. **Collector advantage in ranked:** enforce the parity target in the sim before ranked opens. +8. **Connected density** may be near zero in random collections (good for surprise) or everywhere through country keys (noise). Tune the keys from the sim. Don't guess. diff --git a/docs/night2/reviews/engineer.md b/docs/night2/reviews/engineer.md new file mode 100644 index 0000000..f272264 --- /dev/null +++ b/docs/night2/reviews/engineer.md @@ -0,0 +1,246 @@ +# Night 2 plan review: lead engineer (feasibility and scope) + +Reviewed against `wd` @ 4f7a8a7 (upstream main with Night 1). Paths are repo-relative. `docs/night/REPORT.md` does **not exist** in this checkout, so Night 1 lessons come from HANDBOOK/BOUNDARIES and the coordinator's notes. + +**Verdict:** the plan is feasible in 4.5 h **if** the duel engine is a *new sibling package* with no stack and sorcery-speed only, PvP stays on the self host, and the Wikimedia client is handled as transport-only for the mint path. Three facts change the plan: +1. **Owned cards cannot reach PvP today.** The host never accepts a player deck (see Β§2). +2. **Card data is not trustworthy.** Article and stats are claims made by the miner: consensus only checks internal consistency. +3. **The browser drives most Wikimedia traffic.** Every card face triggers a server enrichment fetch. + +--- + +## 1. Engine: reuse, rewrite, smallest change + +**Reusable as is:** +- `shared/game/rng.ts` (mulberry32, `Rng.fromSeed`, exported via `index.ts:3`) +- the clone-on-apply pattern +- the `(ruleset, decks, seed, actions)` replay contract: `replay` at `engine.ts:433`, `applyAction` at `engine.ts:291` +- zod `parseRuleset` (`ruleset.ts:83`) +- `percentile`/`fame`/`costFor` in `derive.ts:52-79` +- the generated sample percentiles (`card-data.ts`, `scripts/game-card-data.mjs`) + +The host is **engine-agnostic** through `EnginePort` (`server/game/engine-port.ts:9-43`), so a second engine plugs in with a new binding file instead of host surgery. Bots are also engine-agnostic (`shared/bots/types.ts` `EngineAdapter`, with `toAct`, `assume` and `evaluate`), and a sequential duel fits that adapter *better* than Edit War does: `game-adapter.ts:243` fakes `toAct` from `committed`. + +**Must be rewritten:** +- **Everything lane- or Topic-shaped:** + - `MatchState.lanes` / `LaneState` (`types.ts:136-170`) + - the simultaneous queue/commit/reveal turn (`engine.ts:291-363`) + - Topic scoring (`finish`, `engine.ts:366`) + - Portals and keywords (`keywords.ts`, 241 lines, hooks assume lanes and `onReveal`) +- **`GameCard`** (`types.ts:24-43`): a duel card needs `type`, `toughness`, rules-text ids and flavour, and `validateDeck` (`engine.ts:27`) hard-codes cost 0–6, power 0–30, Faction and lane fields. +- **UI boards** (`src/game/MatchBoard.tsx`, `adapter.ts`). +- **`parseModeRuleset`** host checks (`engine-binding.ts:31-43`), which are Edit War-specific: `turns Γ— turnSeconds ≀ 240`, `topicCount`. + +**Recommendation: build `shared/duel/` as a sibling package and leave `shared/game/` untouched.** +- Edit War stays playable: its 6 test files keep passing and its modes keep working. +- Two engine agents don't conflict with anyone. +- Duel exposes the same API names (`createMatch`, `legalActions`, `applyAction`, `viewFor`, `replay`, `validateDeck`, `isOver`, `result`), so `EnginePort` and `EngineAdapter` bindings are thin files. + +**Smallest core that still feels like Magic (one night):** +- **Turn:** start (untap, income, draw) β†’ main β†’ combat β†’ end. No second main phase, no stack, no instants and no priority passing. Events are sorcery-speed only. +- **Triggers** resolve immediately in a fixed order: active player first, then reveal `seq`, as Edit War's `onReveal` already does. +- **Resources:** fixed income ramp, `incomeByTurn` as data (Edit War's `energyByTurn` idea, `types.ts:70`), with no carry. A Location is a permanent that gives +1 income. No land cards means no land screw. +- **Figures** have power, toughness and summoning sickness; damage clears at end of turn. **Institutions and Doctrines** are permanents with `ongoing` statics (port the pure `ongoing` hook contract, `keywords.ts:16`). Life is 20 by default (data). +- **Actions must be atomic** so that `legalActions` stays small. That matters because the host checks each action by deep-equal against the full list (`host.ts:187-189`), and the bots enumerate it: + - `play {cardId, target?}` + - `toggleAttacker {id}`, then `confirmAttack` + - `block {blocker, attacker}`, then `confirmBlocks` + - `endPhase`, `concede`, `timeout` + + Never enumerate whole block assignments, which explode combinatorially. +- **Empty library** behaviour is data: `libraryEmpty: 'lose' | 'reshuffle' | 'fatigue'`. This keeps option (a), small decks with recursion, open with no code change. +- **`legalActions` is `[]` for the seat without priority.** The host sweep already treats "has legal actions" as "is the one waiting" (`host.ts:264`), so timeouts work without host changes. + +**Determinism, rules-as-data, `viewFor` and information hiding all carry over.** +- Hidden information is simpler than in Edit War: there is no simultaneous hidden queue, only the hand and library order. +- **New requirement: `logFor(state, seat)`.** Edit War's `viewFor` returns no log at all (`engine.ts:395-419`). The plan's "dry encyclopedic match log" and the recap both need a per-seat log that masks the opponent's `draw` card ids. +- **Card typing (P31) and "Connected" are not on-chain**, so they must be *frozen into the deck at match start*, exactly as the trend arrow is today (`host.ts:318-334`). Match records already store the derived decks (`host.ts:361-363`), so replay stays exact even if Wikidata changes later. +- **Other host limits:** the host's 2000-action cap (`host.ts:344`) is fine for about 15 turns of atomic actions. `MatchRecord` needs an `engine` field. +- **Multi-engine host** (about 15 lines): + - `ModeHost` holds one `engine` (`host.ts:53`); change to `HostedMode {mode, rules, engine}` and `Lobby.engine`. + - Add an optional `engine: 'editwar' | 'duel'` to `ModeSchema` (`modes.ts:88`, default `editwar`). + - Caveat: the schema is `.strict()`, so un-upgraded peers will count duel modes as `rejected` in discovery. That is acceptable on the testnet. + +## 2. "The cards a player owns": the trace and the gaps + +**Today's path:** +1. The client computes ownership itself. `src/App.tsx:130` filters `snapshot.blocks` (from `GET /api/state`, `http.ts:68` β†’ `legacySnapshot(limits.legacyBlocks)`) by the **browser-local wallet** address. +2. `PlaySection` gets `owned` (`App.tsx:203`) and merges `cardFromBlock` into the deck-builder pool (`PlaySection.tsx:42`). `cardFromBlock` derives in the browser, marks the card `unchecked` with its cost capped, and computes rarity from `powHash` client-side (`cards.ts:39-46`). +3. Owned cards are used **only in browser-local bot matches** (`MatchScreen`). + +**Gaps:** +- **G1. No player decks in PvP.** `ModeHost.join` deals `engine.starterDeck` to both seats for every non-draft policy (`host.ts:144`). The `constructed` policy (`modes.ts:64`, which is also the default, `modes.ts:99`) is **unimplemented**: no create/join route takes a deck (`router.ts:123-131`). Ownership is therefore never verified server-side, because it is never used. +- **G2. Accounts are not wired to the game.** + - Linked wallets live in `accounts.sqlite` (`server/account/store.ts:126-130`), but nothing in `server/game/` reads them. + - `gameRouter` receives only `{dataDir, enrichment}` (`http.ts:154`), with no ledger and no account store. + - The `AccountStore` is created privately inside `createAccountRouter` (`router.ts:19`), so it must be injectable to be shared. + - The `auth` middleware is local to that router (`router.ts:25-33`); export it, or call `verifyIdToken` directly. +- **G3. Host identity is not the account.** The player id is `sha256(localStorage secret HMAC hostOrigin)` (`online.ts:161`, `host.ts:380`), so a ladder keyed on it can be farmed trivially by sybils. Also, `Authorization: Bearer` is already taken by seat tokens with a 16–64 character regex (`router.ts:98-101`). Pass the Dex ID token in the **body** at create/join instead. +- **G4. Collection truncation.** `/api/state` returns at most 128 blocks (`server/resources.ts:20`), so older owned cards silently disappear from Play. Use `ledger.deck(address)`, paged by 24 (`ledger.ts:293`), or a new authed `GET /api/game/collection`. +- **G5. Chain card data is a miner claim.** + - The ledger accepts any peer-valid block. `template()` (`ledger.ts:255`) is advisory, and nothing binds a block to a node-issued template. + - `articleSchema` (`consensus.ts:43-56`) does not cross-check `pageId` against `title`. + - `statsSnapshotSchema` (`consensus.ts:59-93`) only checks internal consistency (`deriveStats` of the declared bytes, languages and views). + - So a custom miner can mint "Barack Obama" with any stats. DESIGN Β§1.10 plausibility exists only as types: `verifyStats` and `check: 'verified'` are never read (no hits outside `types.ts`, `ruleset.ts`, `engine.ts:22` and `derive.ts`). +- **G6. Per-node account stores.** Peer hosts have their own `accounts.sqlite`, so a wallet linked on node A is unknown on node B. Sending a Dex ID token to a peer also lets that peer replay it on other nodes until it expires, since every node shares the `wikideck` audience. + +**Recommended (MVP, self host only):** +- Create and join take `{idToken, deck: tokenId[]}`. The host: + 1. verifies the token (`verifyIdToken`); + 2. loads `wallets(sub)` from the account store; + 3. for each token, checks `ledger.nft(token)` (`canonical-index.ts:163`): owner ∈ wallets and `confirmations β‰₯ rules.minConfirmations` (1 casual, 3 rated); + 4. builds `CardInput` **from the block**, never from client card JSON, then derives and freezes. +- Put this in a new `server/game/ownership.ts` exposing a pure `resolveDeck(deps, sub, tokenIds)`. `host.ts` calls it from `startMatch`. +- Plausibility (G5), stretch: + - Check `pageId β†’ title` and `revisionId β†’ size` with **one batched request per 50 cards** (`prop=revisions&revids=…&rvprop=size|ids`). Revisions are immutable, so the result can be cached forever and verifies `pageBytes` exactly. + - Past monthly pageviews are also immutable, so they can be checked exactly at one request per card. + - On a mismatch, the card is marked `unverified` and its cost is capped. +- Peers (stretch): replace the ID token with a wallet-signed deck claim `["wikideck:deck-claim:v1", NETWORK, hostOrigin, nonce, tokenIds]`. The client builds the message itself, like `shared/account-link.ts`. This needs no account on the peer and cannot be replayed on another host. + +## 3. PvP: what exists, what's needed, transport + +**What exists:** +- **`server/game/host.ts`:** in-memory lobbies, snake draft, the turn timer and AFK handling via `timeoutAction` (`host.ts:263-270`), legal-action enforcement, live-lobby persistence across restarts (`index.ts:205-226`), JSONL match records with replayable audit (`store.ts`) and a W/L leaderboard (`store.ts:64-68`). +- **`router.ts`:** rate-limited (`router.ts:90-94`). +- **UI:** `OnlinePlay.tsx` is a lobby list (polled every 4 s), create/join, draft and a match board. It is reachable only from inside the Play section. + +**What's needed:** + +| Feature | Minimal design | Files | Size | +|---|---|---|---| +| Invite link | `createLobby({private:true})` is excluded from `openLobbies` (`host.ts:108-112`); the UI route `/play/join/` works because the SPA catch-all serves `index.html` (`http.ts:157`), and `join` already takes an id | host, router, OnlinePlay | S | +| Quick match | `POST /modes/:id/quick` joins the oldest open lobby within the rating window, else creates one; no separate queue structure | host, router | S | +| Rated ladder | Elo (K=24, start 1200) per mode, keyed by account id, recomputed by replaying `matches.jsonl` in order at startup (deterministic, no new store); rated only when both seats are account-verified and `rated:true` in mode limits; Glicko-2 is not worth the night | store.ts, host.ts | M | +| Account seat identity | `idToken` in the create/join body β†’ player id `sha256('acct:'+iss+sub)`; guests keep the secret but are unrated | host.ts, online.ts | S | +| Duel binding | `server/game/duel-binding.ts` plus multi-engine `HostedMode` | new file, host.ts | S | + +**Transport is polling:** the client polls every 1 s (`OnlinePlay.tsx:11, 45-50`), with no WebSocket or SSE anywhere. It is adequate for a sequential duel: about 0.5 s average hand-off latency. + +Three caveats: +1. **Cost.** Each poll runs `viewFor` and `legalActions` and returns the full view. Add a monotonic `version` to the lobby and `GET …?v=N` β†’ `204` when unchanged. Poll every 500 ms while waiting on the opponent and every 3 s otherwise. +2. **Do not long-poll under `/api`.** `RpcBudget` caps the whole node at 32 active `/api` requests (`resources.ts:17`, applied at `http.ts:54`), so 16 matches holding long-polls would starve the node. Real push would need SSE mounted *outside* `/api` (a `server/testnet/http.ts` shared-hook change): a stretch only. +3. **Rate limits.** Two humans behind one NAT, or QA agents on one machine, see 1 req/s Γ— 2 against `plays` 240/min and the global 300/min per IP (`http.ts:56`). That is OK, but QA should not run more than 2 matches per IP. + +## 4. Wikimedia politeness + +**Every call site** (grep over `server`, `src`, `scripts`, `shared` and `android`; the browser never calls Wikimedia APIs directly, because CSP `connect-src 'self'` at `http.ts:50` forbids it): + +| # | Where | Upstream | Trigger | Limits today | +|---|---|---|---|---| +| W1 | `server/wiki.ts:73-78` `random()` | en Action API, `generator=random` Γ—10 | **mint template** `http.ts:122` | ≀4 concurrent, 3 attempts, 3.5 s timeout, no 429/Retry-After, no maxlag | +| W2 | `server/enrichment.ts:134-138` `load()` metadata | en Action API, `pageids=1` | `getFresh` at **mint** `http.ts:123`; `get` from `/api/wikipedia/:id` `http.ts:93-98`; TrendCache | ≀4 active, 8 pending, then **reject**; in-memory LRU of 128 entries, 6 h TTL; errors cached 30 s | +| W3 | `server/enrichment.ts:148` pageviews | `wikimedia.org` REST, monthly | same as W2 | same | +| W4 | `server/game/trends.ts:37-56` via `index.ts:174-186` | W2+W3 | background, one page per 20 s | about 8.6k requests/day steady if the queue stays warm | +| W5 | **browser:** `src/Card.tsx:24` β†’ `src/useEnrichment.ts:10` β†’ `/api/wikipedia/:id` | W2+W3 | **every card face rendered** (collection, explorer, hero) | per-tab cache 5 min; server limit is 60/min **per client IP** only, with no node-wide upstream budget | +| W6 | `scripts/night/card_sample.py:13-38` | en API, Wikidata `wbgetentities`, REST daily views | offline research | 1 req/s, honours Retry-After, disk cache (its docstring says "~4 req/s"; the code does 1) | +| W7 | browser `` from `upload.wikimedia.org` (`Card.tsx:28`, CSP `http.ts:49`) | CDN | each render | hotlinking; acceptable, but the plan should cache thumbnails or use `pithumbsize` | + +**Likely cause of the Night 1 429:** W5 fan-out (each grid page means N cards Γ— 2 upstream requests, with a 128-entry LRU thrashing across users) plus W4, multiplied by several testnet nodes sharing one egress IP. Each node also uses the default UA, `Wikideck/0.1 (experimental …)` (`wikimedia-user-agent.ts:4-5`), which has **no contact**. That breaks the Wikimedia UA policy and is the kind of client that gets blocked first. + +**Design: `server/wikimedia/client.ts`, one process-wide `WikimediaClient`.** +- **Rate:** a token bucket per upstream host. Defaults (env-configurable): + - `en.wikipedia.org`: **1 req/s, burst 2** + - `www.wikidata.org`: 1 req/s + - `wikimedia.org` REST: 5 req/s +- **Concurrency:** **1 in flight per host** by default (`WIKIDECK_WIKIMEDIA_CONCURRENCY`). The Action API etiquette is serial requests. +- **Co-located nodes:** document `WIKIDECK_WIKIMEDIA_RPS=0.3` for nodes behind a shared IP (testnet compose). +- **Priority lanes**, with a bounded queue (64): + - `mint`: always first; the timeout starts at dispatch; the queue wait is capped at 15 s, and the miner tolerates it (30 s timeout, `miner.ts:57`) + - `interactive`: on overflow, serve stale cache or 503 + - `background`: trends, P31, links, plausibility; dropped when the queue is full +- **maxlag:** add `maxlag=5` to every Action API request (en and Wikidata). Detect `error.code==='maxlag'` (HTTP 200 with a JSON error), wait for `Retry-After` (default 5 s) and retry at most 3 times. REST has no maxlag. +- **429 and 503:** parse `Retry-After` (seconds or HTTP-date), then **pause the whole host bucket** (circuit-open) for max(Retry-After, exponential backoff 2^n s with jitter, cap 10 min). Log once per pause and expose a counter in `/healthz`-adjacent ops output. +- **Batching:** + - `pageids=`/`titles=`/`revids=` up to 50 for cheap props: `info`, `pageprops` (`wikibase_item`), `description`, `revisions|size`. + - P31 via `wbgetentities&ids=Q1|…(50)&props=claims` is heavy (Obama's claims alone are megabytes). Use `wbgetclaims&property=P31` per entity (small, cached for 30 days), or one WDQS `VALUES` query per ≀50 QIDs. + - **"Connected"** costs one request per deck pair: `prop=links&titles=<≀50 deck titles>&pltitles=&pllimit=max` returns exactly the intra-set links. Cache it by the sorted pageId set. + - **Never batch** `langlinks` or `categories`: their limits are shared across the batch, which forces continuation and changes `languagesTruncated` semantics. +- **Persistent cache:** `node:sqlite` (already used by accounts; Node 24) at `$WIKIDECK_DATA_DIR/wikimedia-cache.sqlite`. Key = canonical URL with sorted params and without `maxlag`. Store the body, ETag and Last-Modified; send `If-None-Match` (REST returns ETags; the Action API mostly doesn't); serve stale-while-revalidate for `interactive`. TTLs: + + | Data | TTL | + |---|---| + | metadata | 24 h | + | monthly pageviews | until month rollover (already the rule, `enrichment.ts:70`); closed months are immutable | + | P31 | 30 d | + | links | 7 d | + | revision size | forever | + | random | never | + + Raise the 128-entry cap (`enrichment.ts:51`) once the cache is on disk. +- **UA:** `WikiDeck/ (+https://gitea.eom.dev/WikiDeck/wikideck; ) node/`. + - Keep `WIKIDECK_USER_AGENT` as an override, still sanitized as at `wikimedia-user-agent.ts:8-12`. + - Warn at startup if there is no operator contact. + - Update `tests/testnet-user-agent.test.ts`, which pins today's fallback strings. +- **Volume budget:** + - mint: 3 requests (≀5 with random retries) + - match: **0 synchronous** (cache-only at match start; unknown data means "no bonus" or a fallback type, as `trends.ts` already does) + - per new card first seen: ≀1 batched metadata/plausibility share + 1 P31 + - per deck save: 1 links request + - card-face render: 0 when cached + +**Consensus boundary (checked carefully):** +- **Validation never touches Wikimedia.** `consensus.ts:43-93` is pure, and the only callers of `wikipediaArticles` and `wikipediaEnrichment` are `http.ts:96, 122-123, 154`. Throttling, caching and retry therefore **cannot affect block validation or fork choice**. +- **The mint template's *content* becomes immutable chain data.** The client must be *transport-only* on the mint path: + 1. Keep W1/W2/W3 request params byte-identical: `grnlimit`, `exchars=900`, `pithumbsize`, `cllimit=20` (no hidden filter, which feeds `category()` at `wiki.ts:17`), `clshow=!hidden`, `cllimit=50`, `lllimit=500`. They determine `article.category`, `languageCount` and `languagesTruncated`, and the percentile calibration. `tests/enrichment.test.ts:42-52` already pins part of this; add a golden URL test for W1. Adding `maxlag` is safe because it changes only error behaviour. + 2. `getFresh` must bypass the persistent cache. `snapshotStats` stamps `capturedAt = new Date()` (`shared/enrichment.ts:41`), so cached data would be misdated. + 3. **Existing bug that throttling would amplify.** A 429/5xx on the pageviews call is swallowed into `status:'unavailable'` (`enrichment.ts:145-164`). On the mint path that **permanently mints a card with `attention: null`**. With the new client, mint must fail the template (503, the miner retries) on 429/5xx/timeout, and record "unavailable" only on a genuine 404 or no-data. Both outcomes are valid blocks, so this is template policy, not a consensus change; it needs one owner and a test. + +## 5. Scope: 4.5 h, about 10 agents, one integration branch + +**Rules learned from Night 1:** +- **No stacked PRs.** Squash-merge makes every child PR conflict. Branch only from `night/2026-11-17` after the dependency has merged. +- **Contracts first:** `shared/duel/types.ts` and `docs/game/DUEL_API.md` merge by 22:15. +- **Node 24 everywhere** (`node:sqlite`; the Dockerfile uses `node:24-alpine`). Check `node -v` before `npm ci`. +- **No new npm dependencies.** The lead alone owns lockfile regeneration. +- **Test files:** top-level `tests/-*.test.ts` only (`scripts/run-tests.mjs:7`). + +**Workstreams** (9 workers plus the lead; ✱ = touches a shared file, one line or a small edit): + +| WS | Owner paths | Delivers | Depends on | +|---|---|---|---| +| A duel-core | `shared/duel/{types,engine,ruleset,index}.ts`, `tests/duel-core*.test.ts`, `docs/game/DUEL_API.md` | turn and combat engine, `viewFor`/`logFor`, `replay`; **types PR by 22:15**, alpha by 23:15 | β€” | +| B duel-cards | `shared/duel/{derive,classify,effects,text}.ts`, `tests/duel-cards*.test.ts` | P31 β†’ type table (from `card-sample.json` `instanceOf`, 236 cards), category fallback, P/T and cost curve, ≀8 effect templates, deterministic MTG-register rules text, flavour from `article.extract` | A types | +| C sim-balance | `shared/bots/duel-adapter.ts`, `scripts/sim/*duel*`, `docs/game/DUEL_BALANCE.md` | greedy and MC bots on duel; win rate by type and faction; ruleset number tuning (data-only PRs) | A alpha (23:15) | +| D wikimedia | `server/wikimedia/*`, `server/wiki.ts`, `server/enrichment.ts`, `server/wikimedia-user-agent.ts`, `tests/wikimedia-*.test.ts` | Β§4 client, mint-path fix, sqlite cache, UA; `trends.ts` unchanged (it goes through enrichment) | β€” (starts 21:30) | +| E identity | `server/game/identity.ts`, `scripts/night2/prebake-identity.ts` | background P31, links and plausibility via D's `background` lane; persistent per-token identity; pre-bakes testnet and mainnet cards | D interface (stub until merged), B input type | +| F ownership | `server/game/ownership.ts`, `server/game/collection.ts`, ✱`server/account/router.ts` (inject store, export auth), ✱`http.ts` (pass `{ledger, accounts}` into `gameRouter`) | `resolveDeck`, `GET /api/game/collection`, chain-pool draft source (option c) | β€” | +| G host-pvp | `server/game/{host,router,store,index,duel-binding}.ts`, `shared/game/modes.ts` (`engine` field), `deploy/night2/modes/*.json` | multi-engine host, constructed decks via F, account seats, private lobbies, invite, quick match, Elo, `?v=` polling | F function signature (agree by 22:00), A types | +| H ui-duel | `src/game/duel/*` (board, card face with type line, P/T, text, flavour; adapter; local bot practice) | playable vs bot in the browser | A types β†’ A alpha | +| I ui-pvp+story | `src/game/OnlinePlay.tsx`, `online.ts`, `PlaySection.tsx`, `Leaderboards.tsx`, `src/game/recap/*`, `shared/duel/recap.ts` | collection deck picker, invite and quick-match UI, ladder, "Battle of X (2026)" recap rendered client-side by `replay` of `GET /matches/:id` (`router.ts:137`) | G API (stub), A log format | +| Lead | integration branch, `docs/night/*`, QA, REPORT | merges, lockfile, end-to-end on testnet with 2 Dex accounts | β€” | + +Overlap is limited to the ✱ lines. `host.ts` is G's alone: F ships pure functions that G calls. + +**Timeline (EST):** + +| Time | Milestone | +|---|---| +| 21:30 | A, D and F start | +| 22:15 | types contract merged; B, G, H and I build against it | +| 23:15 | engine alpha; C starts sims; H plays vs bot | +| 00:00 | D merged; E live; G binds duel; I wired to G | +| 00:45 | balance v1 (data-only tuning) | +| 01:15 | **freeze** | +| 01:15–01:45 | QA PvP plus recap | +| 01:50 | REPORT | +| 02:00 | stop | + +**Cut first, in order:** +1. WDQS/shared-property "Connected": keep article-link Connected only, or none. +2. Plausibility verification (G5): trust chain stats and document the gap. +3. Quick match: invite link and open lobbies suffice. +4. Elo ladder: keep W/L keyed by account. +5. Peer-hosted duel and wallet-signed deck claims. +6. Recap infobox polish: keep the plain encyclopedic log. + +**Never cut:** +- the Wikimedia client (requirement 7: low risk, independent, and protects every later night) +- server-side ownership verification +- the duel core +- self-hosted PvP with owned or draft decks +- bot practice + +**Biggest risks:** +1. Duel engine plus balance in about 2 h of real build time. Mitigation: no stack, atomic actions, effects as ≀8 templates. +2. UI combat readability. H must start on mock views at 22:15, not wait for the alpha. +3. Supply: 12 mainnet cards make a constructed duel unplayable without option (c) or (a). Make deck size and `libraryEmpty` ruleset data so Eric's decision is a mode file, not code. diff --git a/scripts/build-randomx-android.sh b/scripts/build-randomx-android.sh new file mode 100755 index 0000000..37cd70b --- /dev/null +++ b/scripts/build-randomx-android.sh @@ -0,0 +1,35 @@ +#!/bin/sh +# Cross-compile the pinned native RandomX engine (native/, RandomX v1.2.1) for the Android app. +# Output: android/app/src/main/jniLibs//libwikideck_randomx.so, an executable named like a +# library so Android extracts it to nativeLibraryDir, where an app may exec it (docs/night2/MOBILE_MINING.md). +# +# Needs ANDROID_HOME with an NDK (ndk;) and CMake 3.24+ (cmake;, or cmake on PATH). +# ABIS="x86_64 arm64-v8a" JOBS=2 sh scripts/build-randomx-android.sh +set -eu +cd "$(dirname "$0")/.." +: "${ANDROID_HOME:?set ANDROID_HOME}" +ABIS="${ABIS:-arm64-v8a x86_64}" +JOBS="${JOBS:-2}" +API="${ANDROID_API:-24}" +NDK="${ANDROID_NDK_HOME:-$(ls -d "$ANDROID_HOME"/ndk/* 2>/dev/null | sort -V | tail -n1)}" +[ -f "$NDK/build/cmake/android.toolchain.cmake" ] || { echo "No NDK under $ANDROID_HOME/ndk" >&2; exit 1; } +CMAKE_DIR="$(ls -d "$ANDROID_HOME"/cmake/* 2>/dev/null | sort -V | tail -n1 || true)" +[ -n "$CMAKE_DIR" ] && PATH="$CMAKE_DIR/bin:$PATH" +command -v cmake >/dev/null || { echo "cmake not found" >&2; exit 1; } +GEN="" +command -v ninja >/dev/null && GEN="-G Ninja" + +for abi in $ABIS; do + build="native/build-android-$abi" + # shellcheck disable=SC2086 + cmake -S native -B "$build" $GEN \ + -DCMAKE_TOOLCHAIN_FILE="$NDK/build/cmake/android.toolchain.cmake" \ + -DANDROID_ABI="$abi" -DANDROID_PLATFORM="android-$API" \ + -DCMAKE_BUILD_TYPE=Release -DWIKIDECK_RANDOMX_TESTS=OFF + cmake --build "$build" --config Release --target wikideck-randomx --parallel "$JOBS" + out="android/app/src/main/jniLibs/$abi" + mkdir -p "$out" + cp "$build/wikideck-randomx" "$out/libwikideck_randomx.so" + "$NDK"/toolchains/llvm/prebuilt/*/bin/llvm-strip "$out/libwikideck_randomx.so" + ls -l "$out/libwikideck_randomx.so" +done diff --git a/scripts/duel-card-sample.ts b/scripts/duel-card-sample.ts new file mode 100644 index 0000000..31bc49c --- /dev/null +++ b/scripts/duel-card-sample.ts @@ -0,0 +1,32 @@ +/** + * Writes docs/game/duel-card-sample.json (card-sample.json β†’ DuelCard[]) and prints the + * type / Portal / cost / keyword distributions. Offline. Usage: + * node --experimental-strip-types scripts/duel-card-sample.ts [--check] + * --check exits non-zero if the committed fixture is out of date. + */ +import { readFileSync, writeFileSync } from 'node:fs'; +import { deriveSample, type SampleCard } from '../shared/duel/sample.ts'; +import { DERIVE_VERSION } from '../shared/duel/derive.ts'; + +const root = new URL('../', import.meta.url); +const sample = JSON.parse(readFileSync(new URL('docs/game/card-sample.json', root), 'utf8')) as { cards: SampleCard[] }; +const cards = deriveSample(sample.cards); +const out = JSON.stringify({ source: 'docs/game/card-sample.json', deriveVersion: DERIVE_VERSION, count: cards.length, cards }, null, 1) + '\n'; +const path = new URL('docs/game/duel-card-sample.json', root); + +const tally = (f: (c: typeof cards[number]) => string | number) => { + const m = new Map(); + for (const c of cards) m.set(f(c), (m.get(f(c)) ?? 0) + 1); + return [...m].sort((a, b) => String(a[0]).localeCompare(String(b[0]), 'en', { numeric: true })) + .map(([k, v]) => `${k} ${v} (${(100 * v / cards.length).toFixed(1)}%)`).join(', '); +}; +console.log('type:', tally(c => c.type)); +console.log('typedBy:', tally(c => c.typedBy)); +console.log('portal:', tally(c => c.portal)); +console.log('cost:', tally(c => c.cost)); +console.log('subtype:', tally(c => `${c.type}/${c.subtype ?? '-'}`)); +console.log('keywords:', tally(c => c.keywords.join('+') || 'none')); + +if (process.argv.includes('--check')) { + if (readFileSync(path, 'utf8') !== out) { console.error('duel-card-sample.json is stale'); process.exit(1); } +} else writeFileSync(path, out); diff --git a/scripts/night2/prebake-identity.ts b/scripts/night2/prebake-identity.ts new file mode 100644 index 0000000..31c88f0 --- /dev/null +++ b/scripts/night2/prebake-identity.ts @@ -0,0 +1,56 @@ +// testnet-ops (engineer WS E): pre-bake frozen card identities for every card on a chain. +// +// node --experimental-strip-types scripts/night2/prebake-identity.ts --node http://192.168.1.32:3101 \ +// --store $WIKIDECK_DATA_DIR/card-identity.sqlite [--cards docs/game/card-sample.json] [--batch 50] +// +// - Reads the canonical chain from ONE node (GET /api/summary, then /api/canonical pages), so every +// card is built from its mint block, never from client JSON. +// - Facts come ONLY from cached card files (`--cards`, repeatable). This script never calls +// Wikipedia or Wikidata itself. Live facts must go through the wikimedia team's process-wide client +// on its `background` lane (server/wikimedia, #62); that IdentitySource plugs into `prebake()` in +// server/game/identity.ts once it has merged. Until then, unknown cards are left unfrozen and are +// picked up by a later run. +// - Idempotent and freeze-at-first-sight: already frozen tokens are skipped and never rewritten. +import { readFileSync } from 'node:fs'; +import { parseArgs } from 'node:util'; +import { IdentityStore, cachedSource, identityStoreFile, prebake, type ChainArticle } from '../../server/game/identity.ts'; + +const { values } = parseArgs({ options: { + node: { type: 'string', default: 'http://192.168.1.32:3101' }, + store: { type: 'string', default: identityStoreFile() }, + cards: { type: 'string', multiple: true, default: ['docs/game/card-sample.json'] }, + batch: { type: 'string', default: '50' }, +} }); +const nodeUrl = new URL(values.node!); +if (!['http:', 'https:'].includes(nodeUrl.protocol)) throw new Error('--node must be an http(s) WikiDeck node URL'); +if (/wikipedia\.org|wikidata\.org|wikimedia\.org/i.test(nodeUrl.hostname)) throw new Error('--node must be a WikiDeck node, not Wikimedia'); + +async function get(path: string): Promise { + const r = await fetch(new URL(path, nodeUrl), { signal: AbortSignal.timeout(30000), redirect: 'error' }); + if (!r.ok) throw new Error(`${path}: HTTP ${r.status}`); + return await r.json() as T; +} + +type Block = { tokenId: string; article: { pageId: number; title: string; revisionId?: number } }; +async function chainArticles(): Promise { + const { tip } = await get<{ tip: string }>('/api/summary'); + const out: ChainArticle[] = []; + for (let offset: number | null = 0; offset !== null;) { + const page: { blocks: Block[]; next: number | null } = await get(`/api/canonical?tip=${tip}&offset=${offset}&limit=16`); + for (const b of page.blocks) if (b.article && b.tokenId) + out.push({ tokenId: b.tokenId, pageId: b.article.pageId, title: b.article.title, revisionId: b.article.revisionId ?? null }); + offset = page.next; + } + return out; +} + +const cards = values.cards!.flatMap(f => { + const d = JSON.parse(readFileSync(f, 'utf8')); + return Array.isArray(d) ? d : d.cards ?? []; +}); +const articles = await chainArticles(); +const store = new IdentityStore(values.store!); +try { + const report = await prebake(store, cachedSource(cards), articles, { batchSize: Number(values.batch) }); + console.log(JSON.stringify({ node: nodeUrl.origin, chainCards: articles.length, cachedCards: cards.length, ...report, stored: store.count() })); +} finally { store.close(); } diff --git a/scripts/sim/duel-core-sim.ts b/scripts/sim/duel-core-sim.ts new file mode 100644 index 0000000..ab65718 --- /dev/null +++ b/scripts/sim/duel-core-sim.ts @@ -0,0 +1,68 @@ +// DuelSim binding for duel-core's shared/duel engine, with the 236 sample cards derived by duel-cards. +import { readFileSync, existsSync } from 'node:fs'; +import { fileURLToPath } from 'node:url'; +import type { DuelCard, DuelEngineApi, DuelRuleset } from '../../shared/duel/index.ts'; +import { connectedTierOf, duelMetrics, makeDuelAdapter } from '../../shared/bots/duel-adapter.ts'; +import type { DuelSim } from './duel-sim-types.ts'; +import type { PoolCard } from './duel-decks.ts'; + +export interface DuelPoolCard extends PoolCard { title: string; card: DuelCard } + +const FIXTURE = fileURLToPath(new URL('../../docs/game/duel-card-sample.json', import.meta.url)); + +/** The duel engine's functions, whether engine.ts exports them one by one or as an object. */ +async function loadApi(): Promise { + const mod = '../../shared/duel/engine.ts'; + const m = await import(mod) as Record; + const obj = Object.values(m).find(v => v && typeof v === 'object' && typeof v.createDuel === 'function' && typeof v.statsOf === 'function'); + return (obj ?? m) as DuelEngineApi; +} + +async function loadCards(sampleFile: string): Promise { + try { + const mod = '../../shared/duel/sample.ts'; + const { deriveSample } = await import(mod) as { deriveSample: (c: unknown[], r?: unknown) => DuelCard[] }; + const raw = JSON.parse(readFileSync(sampleFile, 'utf8')).cards; + // SIM_DERIVE: JSON patch over duel-cards' DERIVE_RULES (data-only derivation tuning). + if (!process.env.SIM_DERIVE) return deriveSample(raw); + const d = await import('../../shared/duel/derive.ts' as string) as { DERIVE_RULES: Record }; + return deriveSample(raw, { ...d.DERIVE_RULES, ...JSON.parse(process.env.SIM_DERIVE) }); + } catch (e) { + if (process.env.SIM_DERIVE || !existsSync(FIXTURE)) throw e; + return JSON.parse(readFileSync(FIXTURE, 'utf8')).cards as DuelCard[]; + } +} + +export async function makeDuelSim(sampleFile: string, overrides: Record = {}): Promise> { + const api = await loadApi(); + const rs = await import('../../shared/duel/ruleset.ts') as { mergeDuelRuleset: (o: unknown) => DuelRuleset }; + const rules = rs.mergeDuelRuleset(overrides); + let cards = await loadCards(sampleFile); + // SIM_LOCATION_DRAW=n: experiment for duel-design's T2 rider ("When this enters, draw n cards") on every Location. + const locDraw = Number(process.env.SIM_LOCATION_DRAW ?? 0); + if (locDraw > 0) cards = cards.map(c => (c.type === 'Location' ? { ...c, effects: [...c.effects, { trigger: 'onEnter', op: 'draw', amount: locDraw, target: 'controller' } as DuelCard['effects'][number]] } : c)); + const pool: DuelPoolCard[] = cards.map(c => ({ + id: c.cardId, title: c.title, type: c.type, portal: c.portal, cost: c.cost, keywords: [...c.keywords], + fame: (c as any).basis?.fame, card: c, + })); + const engine = makeDuelAdapter(api, { rules, pool: cards }); + // SIM_SECOND_EXTRA=n: experiment for a proposed ruleset key. The second seat starts with n extra cards + // (moved from its library top before mulligans). Sim-only; the engine has no such key yet. + const extra = Number(process.env.SIM_SECOND_EXTRA ?? 0); + if (extra > 0) { + const create = engine.createMatch; + engine.createMatch = (r, d, seed) => { + const s = create(r, d, seed); + const second = (1 - s.firstSeat) as 0 | 1; + const p = s.players[second]; + p.hand.push(...p.library.splice(0, extra)); + return s; + }; + } + return { + name: 'duel', engine, lens: engine.lens, pool, + deckPayload: cs => cs.map(c => c.card), + metrics: duelMetrics, + connected: (a, b) => connectedTierOf(a.card, b.card, rules.connectedTiers), + }; +} diff --git a/scripts/sim/duel-decks.ts b/scripts/sim/duel-decks.ts new file mode 100644 index 0000000..388bd49 --- /dev/null +++ b/scripts/sim/duel-decks.ts @@ -0,0 +1,49 @@ +// 40-card sim decks drawn from a card pool (the 236 real sample cards). Every card is unique (one NFT each), +// so decks sample without replacement. Archetypes skew the type or cost mix. Pure, seeded. +import { mulberry32 } from '../../shared/bots/index.ts'; + +export interface PoolCard { id: string; type: string; portal: string; cost: number; keywords: string[]; fame?: number } +export interface SimDeck { id: string; tags: string[]; cards: C[] } + +export const ARCHETYPES = ['random', 'figure-heavy', 'doctrine-heavy', 'event-heavy', 'location-heavy', 'institution-heavy', 'low-curve', 'high-curve'] as const; +export type Archetype = typeof ARCHETYPES[number]; + +function weight(c: PoolCard, arch: Archetype): number { + switch (arch) { + case 'figure-heavy': return c.type === 'Figure' ? 8 : 1; + case 'doctrine-heavy': return c.type === 'Doctrine' ? 8 : 1; + case 'event-heavy': return c.type === 'Event' ? 12 : 1; + case 'location-heavy': return c.type === 'Location' ? 8 : 1; + case 'institution-heavy': return c.type === 'Institution' ? 10 : 1; + case 'low-curve': return c.cost <= 2 ? 8 : c.cost === 3 ? 3 : 0.3; + case 'high-curve': return c.cost >= 5 ? 8 : c.cost === 4 ? 3 : 0.5; + default: return 1; + } +} + +/** Weighted sampling without replacement (Efraimidis–Spirakis keys). */ +export function buildDeck(pool: C[], arch: Archetype, seed: number, size = 40): SimDeck { + const rng = mulberry32(seed); + const keyed = pool.map(c => ({ c, k: Math.pow(rng(), 1 / Math.max(1e-6, weight(c, arch))) })); + keyed.sort((a, b) => b.k - a.k); + const cards = keyed.slice(0, Math.min(size, pool.length)).map(x => x.c); + return { id: `${arch}#${seed}`, tags: deckTags(cards, arch), cards }; +} + +export function deckTags(cards: PoolCard[], arch: string): string[] { + const count = (f: (c: PoolCard) => string) => { const m: Record = {}; for (const c of cards) m[f(c)] = (m[f(c)] ?? 0) + 1; return m; }; + const top = (m: Record) => Object.entries(m).sort((a, b) => b[1] - a[1])[0]?.[0] ?? '?'; + const avg = cards.reduce((t, c) => t + c.cost, 0) / (cards.length || 1); + const curve = avg < 2.6 ? 'low' : avg < 3.4 ? 'mid' : 'high'; + return [`arch:${arch}`, `portal:${top(count(c => c.portal))}`, `curve:${curve}`, `mainType:${top(count(c => c.type))}`]; +} + +/** n decks: half random, the rest cycling through the skewed archetypes. */ +export function deckSet(pool: C[], n: number, seed: number, size = 40): SimDeck[] { + const out: SimDeck[] = []; + for (let i = 0; i < n; i++) { + const arch: Archetype = i % 2 === 0 ? 'random' : ARCHETYPES[1 + ((i >> 1) % (ARCHETYPES.length - 1))]; + out.push(buildDeck(pool, arch, (seed * 7919 + i * 104729) >>> 0, size)); + } + return out; +} diff --git a/scripts/sim/duel-run.ts b/scripts/sim/duel-run.ts new file mode 100644 index 0000000..5fc9e00 --- /dev/null +++ b/scripts/sim/duel-run.ts @@ -0,0 +1,138 @@ +// Duel balance simulation. +// npx tsx scripts/sim/duel-run.ts --engine duel --matches 2000 --workers 4 --out sim-out/duel [--rules '{"startingLife":18}'] +// Writes /