Night 2 (2026-11-17), from the `claude/wikideck` fork's `night/2026-11-17` branch. It follows Night 1 (#22).
## What's in it
- **Duel engine** (fork #72, #80): 40-card decks of cards you own, Notability/Citations, keywords, effects T1–T12, Connected, a hidden-information-safe `viewFor`/`logFor`, and replay. Balance v1 tuning (#84) gives the first player about 51%.
- **Card profiles** (#70, #82): Figure, Location, Event, Institution or Doctrine, plus stats, keywords and rules text, all derived from real article data. Templates only.
- **Design and story** (#66, #69, #83): DUEL_DESIGN.md, plus the match log and the encyclopedic "Battle of X (2026)" recap.
- **PvP** (#74, #77, #81, #76, #85):
- The server checks ownership, and 40-card eligibility is enforced.
- Modes: Classic (ranked), Draft and Trending.
- Invites, quick match, Elo, a ladder and recap pages. Online matches render on the duel board.
- **Duel board UI** (#79): MTG-style card faces and combat declaration, built for 360 px first.
- **Polite Wikimedia client** (#73, #75): throttled, cached and identified requests, the mint-path fix, and a prefetch pool.
- **Android mining** (#78): native RandomX, as a sideload build. The emulator mined a testnet block.
- **Testnet ops** (#67, #68).
PR numbers refer to `claude/wikideck`.
## Status
- **Tests:** 423, of which 422 pass, 0 fail and 1 is skipped. The build is OK (`node:24-alpine`, `--network none`).
- **Testnet:** running this commit (036489c) on r350.
- **Untouched:** no changes to `server/testnet/consensus.ts`, `randomx.ts`, `native/` or the mainnet compose.
- **Review:** night-review reviewed fork #66–#79. #80–#85 came from the agents' unfinished branches and were not reviewed.
- **Known gaps:**
- The PvP end-to-end test hasn't been run (it needs two eom.dev accounts).
- Bot matches aren't reachable from Play.
- Card identity pre-bake hasn't been done.
- The RandomX verifier latch (`server/testnet/randomx.ts:140`) is still open.
This PR is for Eric to merge.
🤖 Generated with [Claude Code](https://claude.com/claude-code)Reviewed-on: #23
Co-authored-by: Claude <claude@eom.dev>
41 lines
2.2 KiB
Bash
Executable File
41 lines
2.2 KiB
Bash
Executable File
#!/bin/sh
|
|
# sim-testnet: keep the wikideck-night testnet on the integration branch head.
|
|
# Run from the root of a *dedicated* checkout (e.g. a detached git worktree): it checks out
|
|
# each new head of $BRANCH and runs `deploy/night/testnet.sh rolling` (ledgers persist in the volumes):
|
|
# nodes restart one at a time, and deploys wait (up to FORCE_AFTER) while matches or lobbies are live,
|
|
# 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-17}
|
|
API=${API:-https://gitea.eom.dev/api/v1/repos/claude/wikideck}
|
|
INTERVAL=${INTERVAL:-180}
|
|
LOG=${LOG:-/tmp/wikideck-night-autodeploy.log}
|
|
FORCE_AFTER=${FORCE_AFTER:-900} # defer while matches/lobbies are live, but at most this many seconds
|
|
deferred_since=
|
|
enc=$(printf %s "$BRANCH" | sed 's#/#%2F#g')
|
|
while :; do
|
|
new=$(node -e "fetch('$API/branches/$enc',{signal:AbortSignal.timeout(15000)}).then(r=>r.json()).then(b=>console.log(b.commit.id)).catch(()=>{})")
|
|
cur=$(git rev-parse HEAD)
|
|
if [ -z "$new" ]; then echo "WARN branch API failed"
|
|
elif [ "$new" != "$cur" ]; then
|
|
if ! git fetch -q origin "+refs/heads/$BRANCH:refs/remotes/origin/$BRANCH" 2>"$LOG"; then
|
|
echo "WARN fetch failed: $(tail -1 "$LOG")"
|
|
else
|
|
busy=$(deploy/night/testnet.sh busy 2>/dev/null || echo 0)
|
|
now=$(date +%s)
|
|
if [ "${busy:-0}" -gt 0 ] && { [ -z "$deferred_since" ] || [ $((now - deferred_since)) -lt "$FORCE_AFTER" ]; }; then
|
|
[ -z "$deferred_since" ] && { deferred_since=$now; echo "DEFER ${new%"${new#???????}"}: $busy live matches/lobbies"; }
|
|
sleep 60; continue
|
|
fi
|
|
[ -n "$deferred_since" ] && [ "${busy:-0}" -gt 0 ] && echo "FORCE deploy after ${FORCE_AFTER}s ($busy still live)"
|
|
deferred_since=
|
|
git checkout -q --detach "$new"
|
|
echo "DEPLOY start $(git log --oneline -1 | cut -c1-90)"
|
|
if deploy/night/testnet.sh rolling >"$LOG" 2>&1; then
|
|
sleep 20; echo "DEPLOY ok $(git rev-parse --short HEAD): $(deploy/night/testnet.sh status 2>&1 | tr '\n' ' ')"
|
|
else echo "DEPLOY FAILED $(git rev-parse --short HEAD): $(tail -3 "$LOG" | tr '\n' ' ')"; fi
|
|
fi
|
|
fi
|
|
sleep "$INTERVAL"
|
|
done
|