Compare commits

...
Author SHA1 Message Date
adminandClaude Opus 4.5 26b26ea059 Update DEPROTO_PLAN.md with recent completions
- Mark Phase 9 (Utilities) as complete - MapGenerator now protoless
- Mark Phase 10 (History APIs) as complete - PersistedHistory accepts Scala types
- Add PRs #5373, #5378, #5381, #5390 to recent completions
- Update proto import inventory with current counts
- Update success criteria checklist

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-01-17 08:51:26 -08:00
+47 -28
View File
@@ -45,9 +45,11 @@
| Availability (`/library/actions/availability/`) | **0** | ✅ **Complete** |
| Command Choice Helpers (`/library/util/command_choice_helpers/`) | **0** | ✅ **Complete** |
| View Filters (`/library/util/view_filters/`) | **0** | ✅ **Complete** (except boundary code) |
| Other Utilities (`/library/util/`) | **0** | ✅ **Complete** |
| NewGameCreation (`/service/new_game_creation/`) | **0** | ✅ **Complete** (except input GameParameters proto) |
| LLM Prompt Generators (`/library/actions/llm_prompt_generators/`) | **56** | ⏳ Remaining work (34 files) |
| Other Utilities (`/library/util/`) | **7** | ⏳ Remaining work (2 files) |
| Root Library (`/library/`) | **8** | Boundary code (3 files) |
| LLM Request Generators (`/library/actions/llm_request_generators/`) | **2** | ⏳ Remaining work (1 file) |
| Root Library (`/library/`) | **7** | Boundary code (4 files) |
**Total: ~65 proto imports remaining** (down from 149)
@@ -66,7 +68,7 @@
| Phase 6c: AI Clients | **Complete** | AIClient, command choosers all protoless |
| Phase 6d: CommandSelection | **Complete** | Renamed ScalaCommandSelection → CommandSelection |
### Recent Completions (PRs #5326, #5330, #5332, #5333, #5334, #5336, #5341, #5342)
### Recent Completions (PRs #5326-#5390)
1. **CommandFactory protoless** - Now accepts/returns Scala `SelectedCommand` types
2. **AI clients protoless** - `AIClient`, `MidGameAIClient`, all command choosers use Scala types
@@ -81,6 +83,10 @@
11. **StatWithConditionUtils & ProvinceEventUtils protoless** (PR #5342) - Deleted unused proto overloads
12. **IncomingArmyUtils protoless** (PR #5348) - Deleted unused `stats()` method
13. **RansomOfferHelpers deleted** (PR #5351) - Deleted unused dead code file
14. **MapGenerator protoless** (PR #5373) - Returns Scala types instead of proto
15. **Remove proto ActionResult from Engine layer** (PR #5378) - Engine uses Scala `ActionResultT`
16. **NewGameCreation protoless** (PR #5381) - Uses Scala types throughout, no proto conversion
17. **PersistedHistory Scala API** (PR #5390) - New `apply` overload accepts `Vector[ActionResultT]` directly
---
@@ -114,29 +120,26 @@ The LLM prompt generators still use proto types for hero/faction/province data:
**Priority**: Medium - These don't block other migrations and are isolated.
### Phase 9: Remaining Utilities (~1 proto import in 1 file)
### Phase 9: Remaining Utilities ✅ Complete
| File | Proto Usage | Migration Path |
|------|-------------|----------------|
| `ProvinceEventUtils.scala` | ✅ **0** | Deleted unused proto overloads (PR #5342) |
| `StatWithConditionUtils.scala` | ✅ **0** | Deleted unused proto overloads (PR #5342) |
| `MapGenerator.scala` | 1 import | Convert to Scala types |
| `MapGenerator.scala` | **0** | Returns Scala types (PR #5373) |
| `IncomingArmyUtils.scala` | ✅ **0** | Deleted unused `stats()` method (PR #5348) |
| `GameStateViewDiffer.scala` | ✅ **0** | Uses Scala diff types, converts at boundary |
### Phase 10: History APIs 🔄 In Progress
### Phase 10: History APIs ✅ Complete
**Completed:**
- `ActionWithResultingState` now has `scalaActionResult` property (lazy converted from proto)
- `ActionResultFilter.includeForPlayer` uses Scala types (`ActionResultT`, `NotificationT`, `ActionResultType`)
- `GameHistory.withNewResultsScala` preserves both Scala `GameState` and `ActionResultT` to avoid re-conversion
- `PersistedHistory.apply` now accepts `Vector[ActionResultT]` directly (PR #5390)
- `NewGameCreation` is fully protoless (PR #5381)
**Remaining:**
```
src/main/scala/net/eagle0/eagle/service/InMemoryHistory.scala
src/main/scala/net/eagle0/eagle/service/PersistedHistory.scala
```
Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versions.
**Note:** History internals still use proto for persistence (expected - proto is good for disk serialization).
---
@@ -163,9 +166,9 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
### Remaining Proto Usage ⏳
- LLM prompt generators (56 imports in 34 files) - Medium priority
- MapGenerator (1 import) - Low priority
- LLM request generators (2 imports in 1 file) - Medium priority
- BattleFilter (1 import) - Keep (boundary)
- History API internals - Low priority
- Root library boundary code (7 imports in 4 files) - Keep (boundary)
---
@@ -174,10 +177,12 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
| Component | Files | Imports | Priority |
|-----------|-------|---------|----------|
| View Filters | 0 | 0 | ✅ Complete |
| Utility files | 0 | 0 | ✅ Complete |
| History APIs | 0 | 0 | ✅ Complete |
| LLM Prompt Generators | 34 | 56 | Medium |
| Utility files | 1 | 1 | Low |
| Root Library (boundary) | 3 | 8 | Keep |
| **Total** | **37** | **~65** | |
| LLM Request Generators | 1 | 2 | Medium |
| Root Library (boundary) | 4 | 7 | Keep |
| **Total** | **~35** | **~65** | |
---
@@ -190,8 +195,10 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
- [x] Zero proto imports in `/library/util/command_choice_helpers/`
- [x] Zero proto imports in `/library/actions/impl/action/`
- [x] Zero proto imports in `/library/util/view_filters/` (except BattleFilter boundary code)
- [x] Zero proto imports in `/library/util/` (except view filters)
- [x] Zero proto imports in `/service/new_game_creation/` (except input GameParameters)
- [ ] Zero proto imports in `/library/actions/llm_prompt_generators/`
- [ ] Zero proto imports in `/library/util/` (except view filters)
- [ ] Zero proto imports in `/library/actions/llm_request_generators/`
### Architecture
- [x] Clear separation: Scala models (internal) vs Proto (boundaries)
@@ -202,6 +209,8 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
- [x] HeroViewFilter returns Scala types
- [x] ProvinceViewFilter returns Scala types
- [x] All view filters return Scala types
- [x] NewGameCreation uses Scala types
- [x] PersistedHistory accepts Scala types for new games
- [ ] LLM layer uses Scala types
- [ ] No "proto creep" into business logic
@@ -219,7 +228,7 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
## Proto Import Inventory (Detailed)
**Current: ~65 proto imports across 37 files** (as of 2026-01-14)
**Current: ~65 proto imports across ~35 files** (as of 2026-01-17)
### Summary by Directory
@@ -230,10 +239,11 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
| `actions/impl/action/` | 0 | 0 | ✅ Clean |
| `actions/impl/command/` | 0 | 0 | ✅ Clean |
| `actions/llm_prompt_generators/` | 34 | 56 | LLM request types |
| `actions/llm_request_generators/` | 1 | 2 | LLM request types |
| `util/command_choice_helpers/` | 0 | 0 | ✅ Clean |
| `util/view_filters/` | 1 | 1 | ✅ Clean (except boundary) |
| `util/` (other) | 1 | 1 | ✅ Clean |
| Root (`library/`) | 3 | 9 | Boundary code |
| `util/view_filters/` | 0 | 0 | ✅ Clean (except boundary) |
| `util/` (other) | 0 | 0 | ✅ Clean |
| Root (`library/`) | 4 | 7 | Boundary code |
### util/view_filters/ (0 imports, except boundary)
@@ -243,19 +253,20 @@ Change APIs to vend Scala `GameState` and `ActionResultT` instead of proto versi
| `GameStateViewDiffer.scala` | ✅ **0** | Uses Scala diff types, converts at edge |
| `BattleFilter.scala` | 1 | Battle view boundary (keep proto) |
### util/ other files (1 import, 1 file)
### util/ other files ✅ Complete
| File | Imports | Notes |
|------|---------|-------|
| `MapGenerator.scala` | 1 | Map generation |
| `MapGenerator.scala` | **0** | Returns Scala types (PR #5373) |
### Root library/ (8 imports, 3 files)
### Root library/ (7 imports, 4 files)
| File | Imports | Notes |
|------|---------|-------|
| `ActionResultFilter.scala` | 2 | Action result filtering (boundary, uses Scala types internally) |
| `Engine.scala` | 1 | Trait interface |
| `EngineImpl.scala` | 5 | Returns proto for persistence (boundary) |
| `ActionResultFilter.scala` | 3 | Action result filtering (boundary, uses Scala types internally) |
| `Engine.scala` | 1 | Trait interface (returns `ActionResultView` proto for client) |
| `EngineImpl.scala` | 1 | Returns proto for persistence (boundary) |
| `ActionWithResultingState.scala` | 2 | Stores both proto and Scala (boundary for persistence) |
### actions/llm_prompt_generators/ (56 imports, 34 files)
@@ -263,6 +274,14 @@ These files generate LLM prompts and primarily use `internal.generated_text_requ
**Migration strategy**: Can be migrated to Scala types when convenient, but low priority as they're isolated from core game logic.
### actions/llm_request_generators/ (2 imports, 1 file)
| File | Imports | Notes |
|------|---------|-------|
| `DiplomacyResolutionLlmRequestGenerator.scala` | 2 | Uses `DiplomacyOfferStatus` enum and `GeneratedTextRequest` |
**Migration strategy**: Create Scala `DiplomacyOfferStatus` enum and `GeneratedTextRequest` types.
---
## Migration Pattern