[modes] Peer-hosted game modes: schema, node API, host credit, 3 example modes #22

Merged
claude merged 16 commits from night/modes/hosting into night/2026-11-16 2026-11-17 05:05:40 +00:00
16 Commits
Author SHA1 Message Date
claude ae90baca50 Merge remote-tracking branch 'origin/night/2026-11-16' into night/modes/hosting 2026-11-16 23:49:38 -05:00
claude 030fde5ec7 Merge remote-tracking branch 'origin/night/2026-11-16' into night/modes/hosting 2026-11-16 23:33:32 -05:00
claudeandClaude Opus 5.5 ce7ad43e3c Modes: reject non-hostable keywords (obscure) in mode rules; document card-input boundary
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:31:35 -05:00
claudeandClaude Opus 5.5 edcf69f883 Modes: follow engine core ec24437..c938407 (portalReveal, onTopicBonus array, trendDown)
Trending mode sets trendDown -25 so falling trends matter (base rules ignore
them at -200). Doc examples updated and tested.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:21:19 -05:00
claude ac1c255701 Merge remote-tracking branch 'origin/night/2026-11-16' into night/modes/hosting
# Conflicts:
#	server/testnet/http.ts
2026-11-16 23:20:07 -05:00
claude 32f3e3410b Merge remote-tracking branch 'origin/night/engine/core' into night/modes/hosting 2026-11-16 23:19:55 -05:00
claudeandClaude Opus 5.5 59a7c5654c Modes: claim lobby before await in join; trend warm-up 20 s, configurable (review on #22)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:19:55 -05:00
claudeandClaude Opus 5.5 c938407d36 Engine tests: viewFor never leaks opponent hand, deck order, seed or RNG
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:17:04 -05:00
claudeandClaude Opus 5.5 e0ac157ee1 Engine: trendDown -200 default; nullable loaner pageId counts copies per cardId (DESIGN #23/#24)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:14:51 -05:00
claudeandClaude Opus 5.5 ec24437838 Engine core: implement frozen DESIGN v1 (PR #17) and publish ENGINE_API.md
Interleaved reveal, alternating initiative, energy carry, onTopicBonus by cost,
consensus tie-break, hidden Portals with visible stats, laneCapacity 3, Portal
capacity/canPlay/atScoring/allOnTopic hooks, keywordsEnabled dispatch, §10.3
default Topic pool, global reveal seq. KEYWORDS/PORTALS left to engine-b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:13:14 -05:00
claudeandClaude Opus 5.5 670508a4dc Modes: host-side ruleset checks, trust boundary and Wikipedia-load notes (review on #6)
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:04:58 -05:00
claudeandClaude Opus 5.5 a2c2166bcc Modes: follow engine core f3b6097 (trend arrows, timeouts, deckSize)
Live/trending presets freeze the engine's trend arrow from cached live data;
the host turn timer uses the ruleset's turnSeconds and applies the engine's
timeout action (logged, replayable AFK forfeits). Non-draft modes whose rules
make starter decks illegal are rejected at startup. HOSTING.md updated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:04:12 -05:00
claude 8274aab84a Merge remote-tracking branch 'origin/night/engine/core' into night/modes/hosting 2026-11-16 23:03:55 -05:00
claudeandClaude Opus 5.5 7fef46e38e Peer-hosted game modes: mode schema, node API, host credit, three example modes
Modes are inert JSON (shared/game/modes.ts): rule overrides on the engine's
DEFAULT_RULESET, re-validated by parseRuleset; card-mapping presets from a
fixed list; deck policy and limits. server/game/ publishes this node's modes,
discovers configured peers' modes as data (byte cap, timeout, pinned origin),
and hosts lobbies, snake drafts and matches with the deterministic engine.
Finished matches are off-chain JSONL records with seed, decks and action log
(replayable). Per-mode and host leaderboards. Docs in docs/game/HOSTING.md,
including security notes and an on-chain host-reward proposal.

One mount line in server/testnet/http.ts; no consensus changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 23:00:17 -05:00
claudeandClaude Opus 5.5 f3b6097640 Engine core: align with DESIGN.md draft (Edit War)
mulberry32 uint32 seed with the §4 draw order, Topics with stats and Portals,
staggered reveal, initiative and underdog rules, queue/undo/commit/timeout
actions, §9 flat RulesConfig with zod bounds, viewFor hidden info, replay.
cards.ts left to engine-b; placeholder loaners in starter.ts.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 22:55:51 -05:00
claudeandClaude Opus 5.5 7c86ed35f5 Game engine scaffold: seeded RNG, types, Ruleset schema, core loop
Pure deterministic off-chain engine in shared/game: createMatch, legalActions,
applyAction, isOver, result, viewFor, serialize/deserialize, replay. Placeholder
Snap-style lanes rules until DESIGN.md v1; keyword hook registry for engine-b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-16 22:50:45 -05:00