undef-engine
2026-03-26
Game audit remediation, NPC improvements, PhaseEngine rollback, extensive test coverage
75 files · 7,277+ · 1,792-
PhaseEngine hook rollback and games_loaded ping
3 files changed
_phase_engine.pyHook exception handling standardized across all hook types; rollback now includes Pydantic private attrs; fixed kwargs leaktest_ping_route.py72-line test for /api/ping including games_loaded fieldtest_ping_route.pyUpdated ping route tests
- PhaseEngine hook exceptions now handled consistently across all hook types. Rollback corrected to include Pydantic private attrs that were previously missed. /api/ping health response now includes games_loaded count.
instantiate
behavioral
1 file
_phase_engine.py
out_of_spec NPC and faux_facts category-aware lies
2 files changed
npc_actions.pyCategory-aware lie generation in faux_facts NPCnpc_actions.pyNew out_of_spec NPC support
- faux_facts NPC updated to generate category-aware lies rather than generic false statements. out_of_spec NPC handler added as a new game type with full NPC action support.
instantiate
behavioral
1 file
npc_actions.py
Typed action payload models
1 file changed
payloads.pyNew module: typed Pydantic payload models for undef_character action payloads
- Added payloads.py to undef_character with typed Pydantic models for all action payload types, replacing untyped dict access throughout the game’s hooks.
instantiate
behavioral
1 file
payloads.py
Game audit remediation: NPC handlers and config fixes
6 files changed
npc_actions.pyNPC handlers registered for hot_potato_heistnpc_actions.pyNPC handlers registered for liars_handnpc_actions.pyHandlers for join_team, volunteer_spymaster, give_clue, guessnpc_actions.pyShims added for cipher/redaction NPC actionslifecycle.pyRestructured from hooks_class.py to standard flow/hooks/ patternlifecycle.pyFixed level kwarg renamed to character_level to avoid structlog reserved key conflict
- Game audit 2026 identified 33 items across 18 games. 29 are now resolved. Key fixes: NPC handlers registered for hot_potato_heist, liars_hand, cipher; PDQ frontend registry key fixed; hasattr guards removed in TP NPC submission check (typed attributes used directly); dial_in restructured to standard hooks/ directory pattern.
remediate
behavioral
4 files
npc_actions.pynpc_actions.pynpc_actions.pylifecycle.py
React hook extractions
2 files changed
useLobbyActions.tsisHost and currentPlayers moved to useLobbyActions hook returnApp.tsxuseTokenRefresh and useSessionRestoration extracted
In-memory sliding window fallback for WebSocket rate limiter
1 file changed
rate_limiting.pyAdded in-memory sliding window as fallback when Redis backend unavailable; added ws_ratelimit_redis_fallback counter metric
- WebSocket rate limiter now falls back to an in-memory sliding window implementation when Redis is unavailable, rather than failing open. Added ws_ratelimit_redis_fallback counter metric to track fallback activations.
harden
behavioral
1 file
rate_limiting.py
Game documentation: NPC patterns, primitives guide, anatomy, checklist
5 files changed
NPC_PATTERNS.mdThree strategy tiers and NPC testing guideWHICH_PRIMITIVE.mdDecision table for 35 engine primitives including Scoreboard, Deck/Hand/Pile, ActivityStackGAME_ANATOMY.mdRequired/optional files guide with GamePluginBase examplesNEW_GAME_CHECKLIST.md11 gate criteria and verification commandsgame-audit-2026.md18 games, 8-criterion rubric, 33-item remediation backlog; updated post-remediation showing 29/33 resolved, 13/18 fully compliant
- Comprehensive game development docs: NPC_PATTERNS.md with three tier patterns and testing guide; WHICH_PRIMITIVE.md decision table for all 35 engine primitives; GAME_ANATOMY.md with canonical reference game (reaction) annotations; NEW_GAME_CHECKLIST.md with 11 gate criteria; game-audit-2026.md tracking remediation progress.
specify
internal
5 files
NPC_PATTERNS.mdWHICH_PRIMITIVE.mdGAME_ANATOMY.mdNEW_GAME_CHECKLIST.mdgame-audit-2026.md
Massive test coverage expansion
6 files changed
test_engine.py53-line engine phase teststest_post_lock.py14-line post-lock teststest_rate_limiting.py59-line rate limiting teststest_schemas.py505-line schema teststest_server_defaults.py368-line server defaults teststest_factory.py37-line storage factory tests
- Added thousands of unit tests across NPC handlers (cipher, TP, reaction, warp, PDQ, liars_hand, hot_potato_heist, sinky_boat, out_of_spec), game hooks (debate_club, peer_review, sick_day, swarm_think, vote_blind, dice_roll), engine primitives, session rehydration, server defaults, and exception hierarchy. Hollow exception assertions replaced with behavioral checks.
qualify
internal
2 files
test_schemas.pytest_server_defaults.py