KoalaTrapLord
d21928da53
Add PreconController.cs - precon browser scene (U12)
2026-03-18 16:57:01 -04:00
KoalaTrapLord
9b1654a81e
Add CoachController.cs - AI coach chat + analytics dashboard (U9)
2026-03-18 16:29:50 -04:00
KoalaTrapLord
2435e67a6e
Add Unity CI/CD workflow for Windows + WebGL builds ( closes #59 )
2026-03-18 15:19:13 -04:00
KoalaTrapLord
69fe6cbffd
Add MobileInputHandler for touch controls, safe area, responsive UI ( closes #58 )
2026-03-18 15:18:09 -04:00
KoalaTrapLord
3fe3ba0e62
Add WebGLInput.jslib for WebGL JS interop plugin
2026-03-18 15:16:37 -04:00
KoalaTrapLord
643529e874
Add WebGLBridge for WebGL build support, CORS, file input fallback ( closes #57 )
2026-03-18 15:15:36 -04:00
KoalaTrapLord
9746a41178
Add CardController with flip, hover, glow, drag, mobile gestures ( closes #56 )
2026-03-18 15:12:41 -04:00
KoalaTrapLord
b0f48cde62
Add CreateTrainingScene editor script for U11 Training scene
2026-03-18 15:09:19 -04:00
KoalaTrapLord
ec9719659a
Add TrainingController for ML training dashboard ( closes #55 )
2026-03-18 14:37:18 -04:00
KoalaTrapLord
729283c3bd
Create CreateScannerScene.cs
2026-03-18 14:17:41 -04:00
KoalaTrapLord
52dcf95c59
Add ScannerController for scanning and card handling
...
Implement ScannerController for camera scanning and card management.
2026-03-18 14:16:34 -04:00
KoalaTrapLord
4f5135e85b
Add CreateSimulatorScene script for scene setup
2026-03-18 14:06:43 -04:00
KoalaTrapLord
ff3b134cb9
Implement DeckGeneratorController for deck generation
...
This script handles the UI and logic for the DeckGenerator scene, allowing users to select a commander, set strategies and budgets, generate a deck, and view results.
2026-03-18 13:55:47 -04:00
KoalaTrapLord
1c85733743
Add CreateDeckBuilderScene script for UI setup
...
This script creates a DeckBuilder scene in Unity, setting up the UI elements such as panels, buttons, and input fields for managing decks and cards.
2026-03-18 13:48:06 -04:00
KoalaTrapLord
a71abfa7d0
Implement DeckBuilderController for deck management
...
This file implements the DeckBuilderController class, which manages the deck building UI, including deck list, card search, and commander selection functionalities.
2026-03-18 13:36:47 -04:00
KoalaTrapLord
abb1e08249
Add CreateCollectionScene to manage collections
...
This script creates a new Unity scene for managing collections, including UI elements such as buttons, panels, and input fields for searching and filtering cards.
2026-03-18 13:18:54 -04:00
KoalaTrapLord
57b0598717
Unity U5: Add CollectionController.cs — card grid, search, filter, sort, detail panel ( #50 )
...
Implement CollectionController for managing card collection UI, including search, filter, sort, paginImplements all tasks in #50 :
- Infinite scroll card grid using CardPrefab instances with object pooling
- Async Scryfall card image loading via ImageCache.GetSprite()
- Search bar wired to GET /api/collection?search=...
- Filter sidebar: color, type, set, rarity, owned/missing dropdowns
- Sort dropdown: name, CMC, color, type, price
- Card detail panel with flip animation trigger and full card view
- "Add to Deck" button routes to DeckBuilder with card stored in PlayerPrefs
- Pagination / load-more button with page info label
- Mobile: filter drawer auto-hides on narrow screens, collapsible via toggle buttonation, and card detail display.
2026-03-18 12:50:59 -04:00
KoalaTrapLord
292801d445
Add CreateMainMenuScene script for Unity editor
...
This script creates a Main Menu scene in Unity with various UI elements including panels, buttons, and input fields. It also sets up services and saves the scene to the specified path.
2026-03-18 11:31:53 -04:00
KoalaTrapLord
5550c27744
Unity: Add ImageCache.cs singleton for card art Sprite caching ( #50 )
2026-03-18 02:06:08 -04:00
KoalaTrapLord
986c501410
Unity U4: Add MainMenuController.cs - server URL, health check, nav ( #49 )
...
Implements MainMenuController for managing server connection and scene navigation.
2026-03-18 02:05:15 -04:00
KoalaTrapLord
d3431ff246
Unity U3: Add CommanderMeta.cs ( closes #48 )
2026-03-18 02:03:38 -04:00
KoalaTrapLord
36dba9e90a
Unity U3: Add PreconModel.cs ( #48 )
2026-03-18 02:02:59 -04:00
KoalaTrapLord
b9369af52f
Unity U3: Add CollectionResponse.cs ( #48 )
2026-03-18 02:02:20 -04:00
KoalaTrapLord
6dd1de894c
Unity U3: Add DeckGenResponse.cs + GeneratedDeckCard ( #48 )
...
This file defines the DeckGenResponse class and its associated GeneratedDeckCard class, which map to the response structure from the /api/deckgen/v3 endpoint.
2026-03-18 02:01:35 -04:00
KoalaTrapLord
3f1bcb4d12
Unity U3: Add CoachResponse.cs ( #48 )
...
This class maps to the response of the POST /api/coach/chat endpoint, including properties for reply, deck report, and suggestions.
2026-03-18 02:00:43 -04:00
KoalaTrapLord
52762ee0aa
Unity U3: Add SimStatusModel.cs + SimStartResponse ( #48 )
...
This file defines the SimStatusModel and SimStartResponse classes for mapping JSON responses from the API.
2026-03-18 01:59:58 -04:00
KoalaTrapLord
af8e59ed9a
Unity U3: Add DeckModel.cs ( #48 )
2026-03-18 01:59:09 -04:00
KoalaTrapLord
0923b75d79
Unity U3: Add CardModel.cs with Newtonsoft.Json snake_case mapping ( #48 )
...
This class represents a Magic: The Gathering card with various properties such as name, oracle ID, mana cost, and more.
2026-03-18 01:58:24 -04:00
KoalaTrapLord
20172c90b4
Unity U2: Implement all FastAPI endpoint methods in ApiClient.cs ( closes #47 )
2026-03-18 01:56:33 -04:00
KoalaTrapLord
089c1abc8d
Unity: Add ProjectSettings/ProjectVersion.txt for 2022.3 LTS ( #46 )
2026-03-18 01:53:21 -04:00
KoalaTrapLord
646da59e2a
Unity: Add .gitignore for Unity project (Library, Temp, Builds) ( #46 )
2026-03-18 01:52:29 -04:00
KoalaTrapLord
10a7662d51
Unity: Add Fonts/.gitkeep ( #46 )
2026-03-18 01:51:38 -04:00
KoalaTrapLord
a6171b5180
Unity: Add Textures/.gitkeep ( #46 )
2026-03-18 01:51:10 -04:00
KoalaTrapLord
b09fe4b48b
Unity: Add Materials/.gitkeep ( #46 )
2026-03-18 01:50:46 -04:00
KoalaTrapLord
cb8867a808
Unity: Add Prefabs/.gitkeep ( #46 )
2026-03-18 01:50:23 -04:00
KoalaTrapLord
3d6365cfb4
Unity: Add Scripts/Animation/.gitkeep ( #46 )
2026-03-18 01:50:00 -04:00
KoalaTrapLord
397d02240e
Unity: Add Scripts/UI/.gitkeep ( #46 )
2026-03-18 01:49:37 -04:00
KoalaTrapLord
0c842b97fd
Unity: Add Scripts/Models/.gitkeep ( #46 )
2026-03-18 01:49:16 -04:00
KoalaTrapLord
7e94b29c6d
Unity: Add Assets/Scenes/.gitkeep for folder scaffold ( #46 )
...
This file keeps the folder in git
2026-03-18 01:48:49 -04:00
KoalaTrapLord
a5b9d70f04
Unity U2: Add ApiClient.cs singleton HTTP client for FastAPI backend (Epic #45 )
2026-03-18 00:55:40 -04:00
KoalaTrapLord
8103a06992
Unity U1: scaffold unity-client/ folder + README (Epic #45 )
2026-03-18 00:53:39 -04:00
KoalaTrapLord
4e8a999ebd
feat: add Unity/Godot WebSocket server (Phase 1 stub)
...
- pom.xml: add Java-WebSocket 1.5.6 dependency
- bridge/GameWsServer.java: WS server on ws://localhost:7654
- bridge/GameSession.java: Phase 1 stub game loop with human-input queue
- cli/LabCli.java: add ws-server subcommand via picocli
2026-03-18 00:02:18 -04:00
KoalaTrapLord
aa5e381c59
feat: add 4-player batch simulator React page with N-player API endpoint
...
Adds SimulatorPage at /simulator with 4 deck slot selection, config panel, progress polling, per-seat win rate charts, and stats table. Backend: POST /api/sim/run-n-player endpoint using engine.run_n() for 2-4 player batch sims.
2026-03-17 23:59:48 -04:00
KoalaTrapLord
f4da7674b6
feat: React + TypeScript frontend migration (all 12 phases)
...
Complete migration of the Commander AI Lab GUI from vanilla JS to React + TypeScript + Vite + Tailwind.
Phases implemented:
- Phase 1: Vite + React-TS scaffold with proxy config
- Phase 2: TypeScript type definitions (game.ts, constants.ts)
- Phase 3: useGameSocket hook + gameReducer
- Phase 4: Core components (PhaseBar, PlayerZone, CardChip, Board)
- Phase 5: NarrationPanel with auto-scroll
- Phase 6: MoveBar + HandCard
- Phase 7: GameOverOverlay
- Phase 8: App routing + GamePage assembly
- Phase 9: Lobby UI (LobbyPage, RoomPage, useLobbySock, spectator mode)
- Phase 10: Tailwind colour tokens
- Phase 11: Build integration + CI + README
- Phase 12: Test suite (26 tests, all passing)
2026-03-17 22:58:54 -04:00
KoalaTrapLord
3f38a9885f
Slim install script from 3.2MB to git clone approach (~8KB) - closes #31
...
This script installs the Commander AI Lab environment by checking prerequisites, cloning the repository, and installing dependencies.
2026-03-17 16:20:19 -04:00
KoalaTrapLord
940836db7e
Add GitHub Actions CI workflow (lint + test on push) - closes #33
2026-03-17 16:18:50 -04:00
KoalaTrapLord
fd74f157e8
Phase 4: Slim lab_api.py to thin main() - closes #25
...
Refactor lab_api.py to streamline imports, improve logging, and enhance argument parsing.
2026-03-17 16:17:53 -04:00
KoalaTrapLord
179a53c0af
Implement Moxfield deck source adapter ( closes #35 )
2026-03-17 15:59:10 -04:00
KoalaTrapLord
554b166787
Phase 2d/2e/2f: Extract forge_runner, precon_service, import_service/helpers into services/
2026-03-17 15:22:19 -04:00
KoalaTrapLord
874561f423
Phase 2c: Extract card analysis to services/card_analysis.py ( #12 )
2026-03-17 05:14:35 -04:00
KoalaTrapLord
c7309d1ace
Phase 2b: Extract deck service to services/deck_service.py ( #11 )
2026-03-17 05:05:52 -04:00
KoalaTrapLord
5aee93dfae
Phase 1c: Extract datPhase 2a: Extract Scryfall client to services/scryfall.py ( #10 )abase service to services/database.py ( #9 )
2026-03-17 04:54:36 -04:00
KoalaTrapLord
e14a6f9500
Phase 1c: Extract database service to services/database.py ( #9 )
2026-03-17 04:40:44 -04:00
KoalaTrapLord
7baae153ae
Phase 1b: Extract Config, BatchState, AI_PROFILES into models/state.py ( #8 )
2026-03-17 01:57:22 -04:00
KoalaTrapLord
eadf54c670
Phase 1a: Extract Pydantic models into models/requests.py + models/responses.py ( #7 )
2026-03-17 01:45:57 -04:00
KoalaTrapLord
312d13949d
feat: extract ML endpoints into routes/ml.py ( #36 )
...
Moved all 15 /api/ml/* endpoints, 4 state dicts, and 3 background
pipeline functions from lab_api.py into routes/ml.py. Wired via
app.include_router(ml_router) in lab_api.py.
2026-03-17 00:41:31 -04:00
KoalaTrapLord
192c307ca7
refactor( #42 ): deduplicate sim thread functions in deepseek.py
2026-03-17 00:20:51 -04:00
KoalaTrapLord
5cb6e6ce81
refactor( #41 ): remove duplicate _get_deepseek_brain from deepseek.py, import from shared
2026-03-17 00:08:04 -04:00
KoalaTrapLord
01af4d7bcf
cleanup( #38 ): delete stale ROUTES_WIRING.md
...
This doc referenced the old routes._wire autoload pattern and only listed 5 routers. The project now uses 9 direct include_router() calls. Closes #38 .
2026-03-17 00:05:19 -04:00
KoalaTrapLord
301b9d38c8
fix( #40 ): use Path().parent.parent for correct src/ resolution in routes/deepseek.py
2026-03-17 00:02:22 -04:00
KoalaTrapLord
09b0708c4d
fix(models): commander_tax int→dict to match engine per-commander tax tracking
2026-03-16 23:58:07 -04:00
KoalaTrapLord
1121e1cb26
feat: add commander_bonus weight to score_card()
...
Commanders get +5.0 priority in AI spell selection, making the
AI prioritize casting its commander when affordable.
2026-03-17 03:38:14 +00:00
KoalaTrapLord
4bade21220
feat: route commander deaths to command zone instead of graveyard
...
Added _send_to_graveyard() helper that checks card.is_commander
and routes to command_zone (resetting tapped/turn_played) or
graveyard. Applied to all 4 death paths: removal, board wipe,
blocker death, and attacker death in combat.
2026-03-17 03:36:36 +00:00
KoalaTrapLord
46421fe8c4
feat: add commander casting from command zone with tax tracking
...
Second pass in _play_spells() checks command_zone for castable
commanders, applies commander_tax, taps lands, places on
battlefield, and increments tax by 2 for subsequent casts.
2026-03-17 03:34:25 +00:00
KoalaTrapLord
da5e9bd74f
feat: set is_commander during deck loading, place in command_zone
...
- Add commander_names param to run(), run_n(), _create_state()
- Commander card flagged is_commander=True and placed in
player.command_zone instead of shuffled into library/hand
- Only first matching card is extracted (handles singleton rule)
- Backward compatible: commander_names defaults to None
2026-03-17 03:31:35 +00:00
KoalaTrapLord
019a710acd
feat: add command_zone and commander_tax to Player dataclass
...
Adds command_zone (list[Card]) and commander_tax (int, +2 per cast)
to the base Player model so the headless engine can track commander
zone and tax natively without requiring CommanderPlayer wrappers.
2026-03-17 03:18:06 +00:00
KoalaTrapLord
08509b753f
fix: add httpx and websockets to runtime dependencies ( fixes #37 )
...
Both were missing from [project.dependencies] in pyproject.toml and
requirements.txt. httpx is used in web/routers/art.py, and websockets
is needed for the FastAPI WebSocket endpoints in ws.py and lobby.py.
Closes #37
2026-03-17 02:04:09 +00:00
Commander AI Lab
872f6c38ca
security: remove hardcoded API keys, add .env support ( fixes #26 )
...
- Remove plaintext Ximilar and Perplexity API keys from start-lab.bat
- Remove hardcoded key defaults from lab_api.py, lab_api_backup.py, lab_api_new.py
- start-lab.bat now reads from environment variables or .env file
- Add .env.example with placeholder values
- .env already in .gitignore (confirmed)
- Git history purged of all key values via git-filter-repo
Closes #26
2026-03-17 02:00:15 +00:00
KoalaTrapLord
9f7fbef7f8
fix: implement all 19 simulator audit bug fixes
...
Bug fixes across 7 Python files from the deep-dive audit:
engine.py (bugs 1-6):
- Fix summoning sickness (was disabled after turn 0)
- Move untap step before draw (correct MTG ordering)
- Rebuild playable list each iteration (fix mana overspend)
- Menace now allows 2+ blockers instead of preventing all
- Add double strike damage handling (blocked + unblocked)
- (Finish position sort already correct, no change needed)
game_state.py (bugs 7,9,18,19):
- Add .players property returning commander_players
- Add get_legal_moves()/apply_move() stubs
- Initialize commander zone in from_sim_state()
- Sync land_drop_used from engine stats
turn_manager.py (bugs 8,10,11):
- Use sim_state.get_battlefield() + card.tapped attr access
- Replace asyncio.get_event_loop() with get_running_loop()
- Fix APNAP iterations counter (always increment)
- Fix drawn.name and discarded.name (was dict .get())
threat_assessor.py (bugs 12,13,14):
- Use game_state.battlefield(seat) for card iteration
- Use Card dataclass attrs (c.type_line, c.oracle_text, etc)
- Move import re to module top level
models.py (bug 15):
- Word-boundary regex in has_keyword() (fixes reach/ward FPs)
prompt_builder.py (bug 16):
- Remove @staticmethod from module-level _category_label()
rules.py (bug 17):
- Evaluate ramp detection independently of is_removal flag
2026-03-16 20:50:09 +00:00
KoalaTrapLord
2f117eedcb
fix: Java 17 compat - inline ternary in this() call instead of local var
2026-03-16 20:34:05 +00:00
KoalaTrapLord
8f8abb79c6
fix: match actual Forge verbose log format - cast/played/Life:/Zone Change: patterns
2026-03-16 20:25:35 +00:00
KoalaTrapLord
78898f6da0
fix: regex patterns match Forge verbose output, single-winner resolution, 300s clock for 4p
2026-03-16 17:34:12 +00:00
KoalaTrapLord
69242a8f6e
fix: remove duplicate numPlayers declaration in parseForgeOutput
2026-03-16 17:13:48 +00:00
KoalaTrapLord
2b6ccac3ea
fix: hardcoded 3-element arrays in BatchRunner causing empty stats for 4-player games
2026-03-16 17:09:57 +00:00
KoalaTrapLord
94bb369866
feat: add --deck4/--commander4 support for 4-player games in LabCli + BatchRunner
2026-03-16 02:28:06 +00:00
KoalaTrapLord
b57fc9dc2f
fix: add missing stdlib imports (threading, os, re, csv, io, datetime) across route modules
2026-03-16 01:55:17 +00:00
KoalaTrapLord
e1f2b5d89f
fix: add missing os import to collection.py
2026-03-16 01:53:17 +00:00
KoalaTrapLord
9b354e019b
fix: add missing Path import to collection.py
2026-03-16 01:42:37 +00:00
KoalaTrapLord
ac3b76793b
fix: add missing Path, os, threading imports to routes/collection.py
2026-03-15 21:05:35 -04:00
KoalaTrapLord
c60719a0a9
refactor: extract deckgen (14) + coach (12) routes
...
- routes/deckgen.py: classic generator, Perplexity V1, V3 generator + exports
Helpers: _resolve_commander, _generate_deck, _build_collection_summary,
_call_pplx_api, _fill_basic_lands, etc.
Uses _coach._deck_gen_v3 via module reference for V3 state
- routes/coach.py: all coaching endpoints + init_coach_service(),
_build_deck_report_from_db, globals (_coach_service, _deck_gen_v3, etc.)
- lab_api.py: 3265 -> 1063 lines (16 remaining: ML + SPA catch-all)
- Total: 90 extracted + 16 remaining = 106 endpoints verified
2026-03-15 07:26:09 +00:00
KoalaTrapLord
87a2090c68
refactor: extract scanner (6) + deepseek/sim (9) routes
...
- routes/scanner.py: scan, scan/add, re-enrich, auto-classify, auto-classify-all, edhrec
- routes/deepseek.py: sim/run, sim/status, sim/result, sim/run-from-deck,
sim/run-deepseek, deepseek/connect, deepseek/status, deepseek/configure, deepseek/logs
- lab_api.py: 4464 -> 3265 lines (42 remaining endpoints)
- Total: 64 extracted + 42 remaining = 106 endpoints verified
2026-03-15 06:56:02 +00:00
KoalaTrapLord
463b7c1483
Phase 8: Full multiplayer — lobby, private hands, LAN discovery, spectator mode, chat
2026-03-14 23:04:32 -04:00
KoalaTrapLord
a093ab4949
Phase 7: Integration tests, AI benchmarking suite, conftest, pytest config, coverage setup
2026-03-14 21:13:26 -04:00
KoalaTrapLord
b6b1616dad
Phase 6: AI politics engine (deal-making, threat comms, spite logic) + targeting memory
2026-03-14 20:42:48 -04:00
KoalaTrapLord
92bb9b9445
Phase 5: FastAPI server, WebSocket game channel, Scryfall art proxy, REST API, static web client, tests
2026-03-14 20:36:06 -04:00
KoalaTrapLord
3c3dceb737
Phase 4: Add Pygame prototype GUI (gui/ package + tests/test_phase4.py)
2026-03-14 20:10:43 -04:00
KoalaTrapLord
605ff774ed
Phase 3: Add turn_manager.py, threat_assessor.py, tests/test_phase3.py
2026-03-14 19:35:50 -04:00
KoalaTrapLord
441ba7dd74
Phase 2: Add ai_opponent.py, personality_prompts.py, tests/test_phase2.py
2026-03-14 16:53:43 -04:00
KoalaTrapLord
d0e2824038
Phase 1: Add game_state.py, prompt_builder.py, state_logger.py
2026-03-14 16:43:16 -04:00
KoalaTrapLord
8a6fbfaa8a
fix: 3 post-refactor bugs (COMMANDER_META, PRECON_INDEX, startup)
...
Task 1: Move BUILTIN_COMMANDERS + load_commander_meta() to shared.py
Fix import_routes.py to use _shared.COMMANDER_META (module ref)
Task 2: Rewrite precon.py to use _shared.PRECON_INDEX (module ref)
Task 3: Add @app.on_event('startup') safety net for uvicorn --reload
2026-03-14 19:08:21 +00:00
KoalaTrapLord
36077c94ab
refactor: extract 49 endpoints into 5 route modules
...
- Extract collection (10), deckbuilder (18), precon (4), import (5), lab (12) routes
- All share helpers/models/state from routes/shared.py
- Gut lab_api.py from 8872 to 4487 lines (57 remaining endpoints)
- Delete routes/_wire.py and routes/_autoload.py (replaced by include_router)
- Add _scryfall_fuzzy_lookup to shared.py
- 106 total endpoints verified: 49 extracted + 57 remaining
2026-03-14 18:55:32 +00:00
KoalaTrapLord
2c6748a736
feat(brain): swap default model to GPT-OSS 20B via Ollama (localhost:11434)
2026-03-14 14:34:14 -04:00
KoalaTrapLord
585cc1d4a3
feat(engine): load learned_weights.json automatically via load_weights()
2026-03-14 14:30:28 -04:00
KoalaTrapLord
c52eb1c3ef
refactor: extract all shared state, helpers, models into routes/shared.py
2026-03-14 03:15:12 -04:00
KoalaTrapLord
d68b2368b4
fix: remove export_deck_to_sim and _edhrec_cache* from _wire.py (not yet in lab_api.py)
2026-03-14 03:02:45 -04:00
KoalaTrapLord
8d1a916f04
feat(ml): add update_weights.py — outcome-weighted RL learning from decision logs
2026-03-14 02:58:32 -04:00
KoalaTrapLord
2b2383f5c8
wire routes._autoload.register_startup(app) after CORSMiddleware
2026-03-14 02:02:53 -04:00
KoalaTrapLord
911fde9f5f
wire routes._autoload.register_startup(app) after CORSMiddleware
2026-03-14 02:02:26 -04:00
KoalaTrapLord
6799f0c402
wire routes._autoload.register_startup(app) after CORSMiddleware
2026-03-14 01:57:18 -04:00
KoalaTrapLord
da4e225db0
wire routes._autoload.register_startup(app) after CORSMiddleware
2026-03-14 01:55:50 -04:00