Spaces:
Sleeping
Sleeping
Lovecasim Project Structure
This document defines the Single Source of Truth for all file locations. Do NOT create duplicate files in other locations.
π Source of Truth Map
| Component | Canonical Identity | Location | Notes |
|---|---|---|---|
| Frontend | Web UI Assets | frontend/web_ui/ |
ONLY edit here. Served by Flask. |
| Backend | Flask Server | backend/server.py |
The only active server file. |
| Data | Game Data | data/ |
cards.json lives here. Compiler syncs to engine/data/. |
| Engine | Python Logic | engine/ |
Game state, logic, tests. |
| Engine (Rust) | Rust Core | engine_rust_src/ |
Rust source code. |
| Compiler | Data Compiler | compiler/ |
main.py compiles JSON. |
| Tools | Scripts/Utils | tools/ |
All utility scripts. |
| AI | RL Agents | ai/ |
Training and inference code. |
| Reports | Analysis Outputs | reports/ |
Generated analysis and audit reports. |
π« Forbidden / Legacy Paths
| Path | Status | Action |
|---|---|---|
css/ |
DELETED | Use frontend/web_ui/css/ |
js/ |
DELETED | Use frontend/web_ui/js/ |
scripts/ |
MOVED | Moved to tools/_legacy_scripts/ |
engine/data/ |
READ-ONLY | Auto-synced from data/. Do not edit manually. |
backend/server_old.py |
DELETED | Use backend/server.py |
compiler/parser_legacy.py |
DELETED | Use compiler/parser.py |
π οΈ Workflow Rules
Editing Frontend:
- Always work in
frontend/web_ui/. - Do NOT create
frontend/cssorfrontend/js(without web_ui).
- Always work in
Editing Data:
- Edit
data/cards.json. - Run
uv run python -m compiler.mainto compile. - This automatically updates
engine/data/cards_compiled.json.
- Edit
Running Scripts:
- Scripts in
tools/should referencedata/for input/output where possible. - Legacy scripts in
tools/_legacy_scripts/may need migration.
- Scripts in
Tests:
- Run
cargo test --manifest-path engine_rust_src/Cargo.toml --no-fail-fast -- --nocapture. - Rust tests read from
engine/data/(which is synced fromdata/).
- Run
π³ Detailed Tree
loveca-copy/
βββ ai/ # AI Agents & Training
βββ backend/ # Flask Server
β βββ server.py # Main Entry Point
βββ compiler/ # Card Data Compiler
βββ data/ # MASTER Data Directory
β βββ cards.json # Edited by Humans
β βββ cards_compiled.json # Generated
βββ docs/ # Documentation
βββ engine/ # Python Game Engine
β βββ data/ # Symlinked/Synced from ../data
β βββ game/ # Game Logic
β βββ tests/ # Engine support code, not the canonical test suite
βββ engine_rust_src/ # Rust Implementation
βββ frontend/ # Web Interface
β βββ web_ui/ # SERVED Directory
β βββ css/
β βββ js/
β βββ index.html
βββ reports/ # Analysis Reports
βββ tools/ # Utilities & Scripts
βββ _legacy_scripts/ # Archived scripts