docs: update documentation for rules engine integration
- HANDOFF.md: Added rules engine section, updated architecture diagram - state.json: Updated project summary, files_created, files_modified, commit_hash - README.md: Added rules engine to features and architecture - ROADMAP.md: Added MTG Rules Engine Integration section (2.10)
This commit is contained in:
+27
-13
@@ -72,21 +72,27 @@ All planned tasks have been completed:
|
||||
```
|
||||
mtgonline/
|
||||
├── backend/ # FastAPI application
|
||||
│ ├── mtg_rules_engine/ # MTG rules engine (rules enforcement)
|
||||
│ │ ├── engine.py # Core game engine
|
||||
│ │ ├── rules_engine.py # Rules engine core
|
||||
│ │ ├── keywords.py # Card keywords
|
||||
│ │ ├── keywords_db.py # Keywords database
|
||||
│ │ ├── keyword_validator.py # Keyword validation
|
||||
│ │ ├── validator.py # Card validation
|
||||
│ │ ├── updater.py # Engine updater
|
||||
│ │ ├── update_check.py # Update checker
|
||||
│ │ ├── test_engine.py # Engine tests
|
||||
│ │ └── README.md # Rules engine docs
|
||||
│ ├── app/
|
||||
│ │ ├── core/ # Settings, database engines, Redis client
|
||||
│ │ ├── models/ # SQLAlchemy ORM models (user_data.py - 16 models)
|
||||
│ │ ├── routers/ # API route modules (auth, users, decks, rooms, games, admin, cards, interactions, refresh, ws)
|
||||
│ │ │ ├── user_data.py # User data endpoints (replays, collections, groups, etc.)
|
||||
│ │ ├── schemas/ # Pydantic request/response schemas (user_data_schemas.py)
|
||||
│ │ ├── routers/ # API route modules
|
||||
│ │ ├── schemas/ # Pydantic request/response schemas
|
||||
│ │ ├── services/ # Business logic (MTGJSON manager, card DB, game server, deck parser)
|
||||
│ │ └── main.py # FastAPI app entry point (user-data mounted at /api/v1/user-data)
|
||||
│ │ └── main.py # FastAPI app entry point
|
||||
│ ├── alembic/ # Database migrations
|
||||
│ │ ├── env.py # Async Alembic configuration
|
||||
│ │ └── versions/ # Migration scripts
|
||||
│ │ └── 001_initial_user_schema.py
|
||||
│ ├── scripts/ # Utility scripts (downloads, migrations, checks)
|
||||
│ │ └── run_migrations.sh
|
||||
│ ├── Dockerfile # Updated to run migrations on startup
|
||||
│ ├── scripts/ # Utility scripts
|
||||
│ ├── Dockerfile
|
||||
│ ├── requirements.txt
|
||||
│ └── .env.example
|
||||
├── docker-compose.dev.yml # Development stack
|
||||
@@ -300,11 +306,19 @@ The v1 backend work has been completed. The following features were implemented:
|
||||
- **Admin**: User list, ban management
|
||||
- **Data Management**: MTGJSON refresh
|
||||
|
||||
#### 5. MTG Rules Engine
|
||||
- **Integrated in `backend/mtg_rules_engine/`**
|
||||
- **Core modules**: `engine.py`, `rules_engine.py`, `keywords.py`, `validator.py`
|
||||
- **Supporting modules**: `keywords_db.py`, `keyword_validator.py`, `updater.py`, `update_check.py`
|
||||
- **Test suite**: `test_engine.py`
|
||||
- **Purpose**: Enforces MTG game rules (mana, phases, priority, stack resolution, combat) for multiplayer server
|
||||
|
||||
### Testing & Verification
|
||||
- ✅ All API endpoints tested and working
|
||||
- ✅ Database migrations applied successfully
|
||||
- ✅ Docker deployment verified
|
||||
- ✅ Integration tests passing
|
||||
- ✅ Rules engine source files extracted and integrated
|
||||
|
||||
---
|
||||
|
||||
@@ -633,10 +647,10 @@ Current state saved at: `/home/wall-o/projects/mtgonline/state.json`
|
||||
|
||||
---
|
||||
|
||||
**Last Updated**: 2026-07-24T04:35:00-04:00
|
||||
**Status**: Phase 1-2 Complete. Phase 3 (Multiplayer Game Server) in progress. Game engine code incoming.
|
||||
**Last Updated**: 2026-07-25T19:58:00-04:00
|
||||
**Status**: Phase 1-2 Complete. Phase 3 (Multiplayer Game Server) in progress. Rules engine integrated in `backend/mtg_rules_engine/`.
|
||||
|
||||
**Next Action**: Begin Phase 3 — set up multiplayer server scaffolding, integrate game engine, implement WebSocket hub with chat support.
|
||||
**Next Action**: Begin Phase 3 — set up multiplayer server scaffolding, integrate rules engine, implement WebSocket hub with chat support.
|
||||
|
||||
**Timeline**:
|
||||
| Phase | Duration | Status |
|
||||
|
||||
Reference in New Issue
Block a user