KoalaTrapLord
11978736a1
fix: raise BRAIN_TIMEOUT default from 30s to 120s ( #71 )
2026-03-21 19:39:29 -04:00
KoalaTrapLord
8ed3fbc627
feat(ml): add quality gate & validation module ( #67 )
...
Phase 3 of closed-loop distillation pipeline.
- QualityGateConfig with configurable thresholds
- create_forge_holdout() for Forge-only eval split (12% by game_id)
- check_accuracy_gate() rejects PPO batch if Forge eval accuracy drops
- check_win_rate_gate() blocks export below configurable win rate
- compute_quality_metrics() logs action entropy, reward distribution
- QualityGate orchestrator class with evaluate_ppo_batch()
2026-03-21 19:34:37 -04:00
KoalaTrapLord
4d50449145
feat(ml): add source awareness to dataset builder ( #66 )
...
Phase 2 of closed-loop distillation pipeline.
- Scan both ml-decisions-sim-*.jsonl (Forge) and ml-decisions-ppo-*.jsonl (PPO)
- Add source_weights config for configurable sampling ratios
- Add min_reward_threshold filter for PPO data quality
- Tag each sample with source for downstream analysis
- New CLI args: --forge-weight, --ppo-weight, --min-reward
- NPZ output now includes 'sources' array
2026-03-21 19:28:22 -04:00
KoalaTrapLord
f986d236ab
Reduce coach prompt limits and raise LLM timeout for R1 compatibility
2026-03-21 19:08:24 -04:00
KoalaTrapLord
3957285a2e
feat(ml): add PPO DecisionExporter for closed-loop distillation ( #65 )
...
Phase 1 of closed-loop distillation pipeline.
Adds DecisionExporter class that captures PPO self-play decisions
as JSONL files compatible with the Forge DecisionSnapshot schema.
Includes PPO-specific metadata fields (source, model_version,
reward, episode_return) and configurable win-only filtering.
2026-03-21 18:06:45 -04:00
KoalaTrapLord
3cca49c5a9
docs: add closed-loop iterative distillation implementation roadmap
2026-03-21 17:55:18 -04:00
KoalaTrapLord
f290523ce1
fix(ml): replace undefined 'log' with 'logger' in labeler.py
2026-03-21 15:47:47 -04:00
KoalaTrapLord
448cec128c
feat(ui): add 12 and 16 thread options to batch runner dropdown
2026-03-21 15:22:20 -04:00
KoalaTrapLord
6612f3d213
fix: use correct key best_val_acc in training completion message
2026-03-21 15:21:35 -04:00
KoalaTrapLord
06f007e605
fix: invert guard in _load_deck_cards_by_name — was if not deck_row (crash on None[0])
...
The guard condition was inverted: `if not deck_row:` entered the query
block when no deck was found, causing `deck_row[0]` to crash with
'NoneType' object is not subscriptable. Flipped to `if deck_row:`
so the query runs only when the deck exists.
2026-03-21 15:11:08 -04:00
KoalaTrapLord
1397f93b91
feat(ml): wire ML decision flush in _finish_sim for all sim threads
2026-03-21 14:30:47 -04:00
KoalaTrapLord
f86a4af86f
feat(ml): add ML decision logging to base GameEngine
...
- Add ml_log param, ml_decisions list, flush_ml_decisions() to GameEngine
- Capture ML snapshots at each player turn in run_n()
- Stamp game_outcome (win/loss per seat) on all decisions
- Add _capture_ml_snapshot() matching DeepSeekGameEngine format
- Add game_id and archetype params to run_n() for ML tracking
- Import logging, uuid; add logger
2026-03-21 13:54:33 -04:00
KoalaTrapLord
0e99f814fc
chore: remove unused React scaffold frontend/
2026-03-21 13:45:08 -04:00
KoalaTrapLord
8c34cb0966
feat: Phase 8 — surface player_explanation in simulation results JSON
...
Extract player_explanation from validation dict in each turn log
entry within _run_game_loop(). The React frontend can now render
validator explanations when player_explanation is non-null.
2026-03-21 13:37:09 -04:00
KoalaTrapLord
c67ce422d8
refactor: rename LM_STUDIO/LMStudioClient to LLM/LLMClient in routes/coach.py
2026-03-21 13:34:21 -04:00
KoalaTrapLord
cb4b48e362
refactor: rename LMStudioClient to LLMClient in coach_service.py
2026-03-21 13:33:00 -04:00
KoalaTrapLord
4a8db4db6b
refactor: rename LM_STUDIO/LMStudioClient to LLM/LLMClient in llm_client.py
2026-03-21 13:31:32 -04:00
KoalaTrapLord
9c0fa64a69
feat: Phase 7 — add validation field to decision log schema
...
Add "validation" key to _log_decision() entry dict in deepseek_brain.py.
Captures result.get("validation") (None if validator disabled)
for R1-14B output preservation and future analysis.
2026-03-21 13:31:08 -04:00
KoalaTrapLord
c338f16965
refactor: rename LM_STUDIO_* to LLM_* in coach/config.py
2026-03-21 13:29:51 -04:00
KoalaTrapLord
a7ab0e43a5
feat: Phase 6 — make primary brain env-configurable (BRAIN_* vars)
...
Replace hardcoded DEEPSEEK_API_BASE/DEEPSEEK_MODEL env vars in
_get_deepseek_brain() with new BRAIN_* environment variables:
- BRAIN_API_BASE (default: http://localhost:11434 )
- BRAIN_MODEL (default: gpt-oss:20b)
- BRAIN_TEMPERATURE (default: 0.3)
- BRAIN_MAX_TOKENS (default: 1024)
- BRAIN_TIMEOUT (default: 30.0)
All params now passed directly to DeepSeekConfig constructor.
2026-03-21 13:21:58 -04:00
KoalaTrapLord
8b527d7c30
fix: remove duplicate ml_log=True kwarg in deepseek.py
2026-03-21 12:48:56 -04:00
KoalaTrapLord
36760dd922
fix(ml): rename log -> logger in dataset_builder.py to fix NameError
2026-03-21 12:42:02 -04:00
KoalaTrapLord
963a5db638
fix(ml): enable ml_log=True in deepseek route engine calls
2026-03-21 12:41:01 -04:00
KoalaTrapLord
b1996a8deb
fix: indent __init__ into DeepSeekGameEngine class body
2026-03-20 22:01:25 -04:00
KoalaTrapLord
c44d0b32bb
Update DeepSeek port from 1234 to 11434 in deepseek_engine.py
2026-03-20 21:55:10 -04:00
KoalaTrapLord
a78df75014
Update DeepSeek port from 1234 to 11434 in SimulatorPage.tsx
2026-03-20 21:54:22 -04:00
KoalaTrapLord
9020d29745
Update DeepSeek port from 1234 to 11434 in deepseek_brain.py
2026-03-20 21:53:27 -04:00
KoalaTrapLord
b0a34ae9e2
Update DeepSeek port from 1234 to 11434 in coach.py
2026-03-20 21:52:39 -04:00
KoalaTrapLord
4c4f5ce0ff
Update DeepSeek API port from 1234 to 11434 in config.py
2026-03-20 21:51:42 -04:00
KoalaTrapLord
1e7f4b4e31
Update DeepSeek API port from 1234 to 11434 (Ollama)
2026-03-20 21:49:49 -04:00
KoalaTrapLord
488575f3df
fix(routes): correct indentation of validator line in _run_sim_thread_deepseek
2026-03-20 21:42:11 -04:00
KoalaTrapLord
fd7f0258f3
feat(routes): add validator singleton and /api/validator endpoints
2026-03-20 21:27:15 -04:00
KoalaTrapLord
7284b8617d
feat(sim): wire DeepSeek-R1-14B validator into deepseek_engine
2026-03-20 21:16:16 -04:00
KoalaTrapLord
678cc13fe0
feat: enable ML logging by default in lab.py
2026-03-20 21:05:37 -04:00
KoalaTrapLord
19f83a546b
feat: enable ML logging by default in shared.py
2026-03-20 21:01:40 -04:00
KoalaTrapLord
c53e82bfeb
feat(sim): add DeepSeek-R1-14B validator brain module
2026-03-20 17:20:30 -04:00
KoalaTrapLord
f8b13703b8
fix: CAST_PATTERN now matches both 'cast' and 'casts' for Forge compatibility
2026-03-20 15:04:37 -04:00
KoalaTrapLord
eb59a2cd2e
fix: increase default clock from 120s to 300s for Commander games to prevent premature timeouts
2026-03-20 14:58:24 -04:00
KoalaTrapLord
ff6040b53e
Remove stray closing brace that would break compilation
2026-03-20 13:31:50 -04:00
KoalaTrapLord
db7bc62d7e
Fix commander damage tracking, add PLAYER_DAMAGE_SOURCE_PATTERN and diagnostic logging
2026-03-20 13:28:54 -04:00
KoalaTrapLord
fbffe81846
feat: auto-detect commander card names from .dck files for commander cast tracking
2026-03-20 12:48:48 -04:00
KoalaTrapLord
9369cf5450
docs: fix adapter.py docstring to reference lab_api.py instead of deleted lab_api_new.py
2026-03-20 12:19:07 -04:00
KoalaTrapLord
e38401a740
chore: remove obsolete lab_api_backup.py (superseded by lab_api.py + routes/)
2026-03-20 12:17:44 -04:00
KoalaTrapLord
111764615d
chore: remove obsolete lab_api_new.py (superseded by lab_api.py + routes/)
2026-03-20 12:16:50 -04:00
KoalaTrapLord
2088da6fd8
fix: correct indentation in _resolve_forge_dir forge-gui sibling check
2026-03-20 11:33:42 -04:00
KoalaTrapLord
a2fbc30b2b
fix: resolve forge_dir to forge-gui sibling when res/ not found in forge-gui-desktop
2026-03-20 11:22:44 -04:00
KoalaTrapLord
a62640668b
fix: update DeepSeek endpoint IP in lab_api_backup.py
2026-03-20 11:11:07 -04:00
KoalaTrapLord
b8e12dff1b
fix: update DeepSeek endpoint IP in lab_api_new.py
2026-03-20 11:10:15 -04:00
KoalaTrapLord
ea0a785174
fix: update DeepSeek endpoint IP in SimulatorPage.tsx
2026-03-20 11:09:27 -04:00
KoalaTrapLord
9f1277f233
fix: update DeepSeek endpoint IP in deepseek_engine.py
2026-03-20 11:08:32 -04:00
KoalaTrapLord
66ce887fe3
fix: update DeepSeek endpoint IP in deepseek_brain.py docstring
2026-03-20 11:07:38 -04:00
KoalaTrapLord
80f63f192a
fix: update DeepSeek endpoint IP in coach.py
2026-03-20 11:06:30 -04:00
KoalaTrapLord
46ed2f5606
fix: update DeepSeek endpoint IP from 192.168.0.122 to 192.168.0.240 in simulator.html
2026-03-20 11:05:10 -04:00
KoalaTrapLord
93a421b90a
fix: make colons optional in all regex patterns to match Forge output format (no colons after Game Outcome, Life, Add To Stack, Land, Zone Change, etc.); fix VERBOSE_TURN_PATTERN for 'Turn Turn N AiX' format; fix LIFE_CHANGE_PATTERN to use space instead of > separator
2026-03-20 09:26:02 -04:00
KoalaTrapLord
ee95f26bc4
fix: restore double-backslash escaping in Ai regex patterns (fixes compilation errors)
2026-03-20 09:03:55 -04:00
KoalaTrapLord
2ee574f678
diag: add [COMBAT-LINE] logging to identify Forge verbose output format for combat stats parsing
2026-03-20 08:15:03 -04:00
KoalaTrapLord
473a2bdcc7
fix: make Ai regex patterns support both Ai(N) and AiN formats for Forge output compatibility
2026-03-19 23:29:53 -04:00
KoalaTrapLord
a6e50ee0f0
feat: aggregate combat stats in StatsAggregator
2026-03-19 22:45:05 -04:00
KoalaTrapLord
e2a6a75fd9
feat: add combat stat fields to DeckSummary schema
2026-03-19 22:39:51 -04:00
KoalaTrapLord
030bdf2b81
fix: CAST_PATTERN and LAND_PLAY_PATTERN regex to match Forge verbose log prefixes
...
- CAST_PATTERN: Add optional (?:Add To Stack:\s*)? prefix to match Forge's verbose log format
- LAND_PLAY_PATTERN: Add optional (?:Land:\s*)? prefix to match Forge's verbose log format
- Add [PARSE] diagnostic logging after combat stats parsing to confirm spells/lands/cmdr stats per seat
Root cause: Forge verbose output prefixes cast lines with "Add To Stack: " and land lines with "Land: "
but the regexes expected Ai(N) at the start of the line, causing 0 matches for all combat stats.
2026-03-19 22:06:17 -04:00
KoalaTrapLord
e5377ef4bc
fix: correct indentation and add forge-gui candidate path
2026-03-19 18:24:57 -04:00
KoalaTrapLord
56ea2602b4
fix: scan sibling dirs for res/ in _resolve_forge_dir (finds forge-gui/res)
2026-03-19 18:19:32 -04:00
KoalaTrapLord
d86109c5c0
Fix duplicate WHERE clause in _load_deck_cards_by_name SQL query
2026-03-19 17:54:34 -04:00
KoalaTrapLord
d9dd098ca3
fix: add power, toughness, keywords to _load_deck_cards_by_name SQL query
2026-03-19 17:43:57 -04:00
KoalaTrapLord
69ce5b340e
fix: normalize indentation in _finish_sim (line 184-185)
2026-03-19 17:13:13 -04:00
KoalaTrapLord
103a74a0e1
fix: update DeepSeek brain default api_base to 192.168.0.240:1234
2026-03-19 17:11:56 -04:00
KoalaTrapLord
147121582b
fix: update DeepSeek/LM Studio default URL to 192.168.0.240:1234
2026-03-19 17:10:14 -04:00
KoalaTrapLord
8be96ab47d
fix: use coach.report_generator for deck report generation
2026-03-19 17:05:03 -04:00
KoalaTrapLord
e2653b3f72
fix: align sim results path with coach (routes/results)
2026-03-19 17:03:00 -04:00
KoalaTrapLord
7efac34279
fix: persist sim results to disk + auto-generate deck reports
2026-03-19 16:59:55 -04:00
KoalaTrapLord
b00df14f30
fix: use card_name key from _load_deck_cards_by_name (KeyError: 'name')
2026-03-19 16:51:27 -04:00
KoalaTrapLord
3542efd982
fix: align build_java_command with LabCli picocli args (--forge-jar, --forge-dir, --deck1..4)
2026-03-19 16:42:03 -04:00
KoalaTrapLord
1f93b5510d
fix: add missing load_weights() to rules.py
2026-03-19 15:49:00 -04:00
KoalaTrapLord
5c31be6023
fix: add Config extra=ignore to DeckCardWithStatus to prevent 422 from adapter extra fields
2026-03-19 15:34:18 -04:00
KoalaTrapLord
76139477be
fix: replace pplx.model with getattr, update V3 error messages for Ollama
2026-03-19 15:26:15 -04:00
KoalaTrapLord
0e5d7ba7d3
fix: harden _find_java17 to search multiple vendors, JAVA_HOME, and warn on wrong version
2026-03-19 15:23:44 -04:00
KoalaTrapLord
4ec6ed57d5
fix: add missing urllib imports to deckbuilder.py for Scryfall card lookup
2026-03-19 15:11:33 -04:00
KoalaTrapLord
08d81a4336
fix: remove stale Perplexity API key error message, allow Ollama/local mode to generate without hard block
2026-03-19 14:58:39 -04:00
KoalaTrapLord
f6ed40a253
fix: correct indentation in init_coach_service V3 deck gen block
2026-03-19 14:46:16 -04:00
KoalaTrapLord
9fd39e42c7
feat(phase-10): add DeckBuilderAdapter unit tests
2026-03-19 14:35:00 -04:00
KoalaTrapLord
72107df2ae
feat(phase-10): add comprehensive Pydantic model tests
2026-03-19 14:32:43 -04:00
KoalaTrapLord
2738bbdba4
feat: add scrython>=2.0.0 to requirements.txt
2026-03-19 14:28:38 -04:00
KoalaTrapLord
0bbc78ef23
fix: rewire routes/coach.py to use DeckBuilderAdapter + fix IndentationError
2026-03-19 14:02:23 -04:00
KoalaTrapLord
c2b470e251
refactor: replace DeckGeneratorV3 import with DeckBuilderAdapter alias
2026-03-19 13:50:30 -04:00
KoalaTrapLord
6135feb644
feat: add run_substitution stub + clean up adapter
2026-03-19 13:49:13 -04:00
KoalaTrapLord
b3b664872b
refactor: rewire V3 deck gen init to use DeckBuilderAdapter (Ollama)
2026-03-19 13:41:15 -04:00
KoalaTrapLord
a80e8908e1
fix: indent _deck_gen_v3_error inside if block in coach.py
2026-03-19 13:35:44 -04:00
KoalaTrapLord
a8ef10d5b7
feat: add DeckBuilderAdapter to bridge Ollama pipeline to legacy API
2026-03-19 13:24:29 -04:00
KoalaTrapLord
86af4b6de5
fix: close missing paren in _call_pplx_api client.post()
2026-03-19 13:16:22 -04:00
KoalaTrapLord
332606d6b5
Merge pull request #62 from KoalaTrapLord/feat/deck-builder-phase0
...
feat: Commander AI Deck Builder (Ollama gpt-oss:20b)
2026-03-19 12:45:04 -04:00
KoalaTrapLord
70dfa3d3e0
fix: robust JSON extraction for LLM responses (_extract_json)
2026-03-19 12:29:49 -04:00
KoalaTrapLord
f970b6d571
fix: api __init__ imports modules not classes
2026-03-19 12:08:26 -04:00
KoalaTrapLord
5ade916207
fix: make conversation log always visible with initial ready message
2026-03-19 11:50:52 -04:00
KoalaTrapLord
cc53c58344
feat(phase-0): add deck builder deps (requests, bs4, ollama)
2026-03-19 11:33:45 -04:00
KoalaTrapLord
3e64aa67eb
feat(phase-6): implement deck assembler (Ollama JSON parser)
2026-03-19 11:32:14 -04:00
KoalaTrapLord
70a7c07b81
feat: add conversation log panel below Generate Deck button
2026-03-19 11:31:10 -04:00
KoalaTrapLord
1b4e9f5a66
feat(phase-3): implement community scraper (Moxfield + Archidekt)
2026-03-19 11:30:53 -04:00
KoalaTrapLord
c962d1f16a
feat(phase-9): implement FastAPI + CLI entrypoint
2026-03-19 11:29:29 -04:00
KoalaTrapLord
dcdf15c56a
feat(phase-8): add deck_builder package init with public API
2026-03-19 11:28:08 -04:00
KoalaTrapLord
b0214009f4
feat(phase-8): add api __init__ exports
2026-03-19 11:27:07 -04:00