Skip to content

Revive Avalonia app: align BSO with the new MotelyJAML#21

Open
OptimusPi wants to merge 3 commits into
mainfrom
claude/revive-avalonia-app-7W1Mw
Open

Revive Avalonia app: align BSO with the new MotelyJAML#21
OptimusPi wants to merge 3 commits into
mainfrom
claude/revive-avalonia-app-7W1Mw

Conversation

@OptimusPi
Copy link
Copy Markdown
Owner

What this does

The new MotelyJAML deleted Motely.API, Motely.DB, Motely.Orchestration, and the legacy MotelyJsonConfig + JsonSearchParams + SearchOptionsDto types. BSO leaned on all of it in ~30 files. This branch gets BSO compiling again on top of the new submodule.

Phase 1 — dead-dep sweep (d140c69)

  • Bumped src/MotelyJAML submodule to the new tip (84a79e4)
  • Deleted ApiHostWidget + DesktopApiHostService + SequentialLibraryInitializerService + RestoreActiveSearchesProviderService + ResultsDatabaseExporter + their interfaces
  • Stripped sln entries and ProjectReferences for the three dead Motely.* csprojs
  • Collapsed duplicate .gitmodules stanza

Phase 2 — port (a282a96)

  • Lifted slim DTOs into src/BalatroSeedOracle/Motely/ (no PostProcess pipeline, no MotelyEnumParser):
    • MotelyJsonConfig + MotelyJsonFilterClause + SourcesConfig + MotelyFilterDefaults
    • MotelyJsonSerializerContext (AOT source-gen target)
    • SearchOptionsDto, JsonSearchParams
  • New seam: IMotelySearchContext + MotelySearchStatus + MotelySearchResultRow so BSO keeps a stable shape while the engine swaps underneath
  • MotelySearchOrchestrator + MultiSearchManager rebuild a pending search context — they compile and accept the BSO call shape but the real JamlSearchBuilder wiring lands in a follow-up
  • MotelyJsonConfigYaml round-trips MotelyJsonConfig through YamlDotNet; JamlConfigLoader compat shim under Motely namespace maps the old TryLoadFromJamlString / TryLoadFromJaml names; JamlFormatter keeps the JAML-editor "format" command working
  • Pruned ApiHost / SequentialLibrary references from BalatroMainMenuViewModel, MainWindowExtensions, ToolsModal, ModalHelper, Program.cs, SearchManager
  • Two AnalyzerViewModel lines updated for the new MotelyAnalyzedItemMotelyItem cast

Status

  • dotnet build src/BalatroSeedOracle/BalatroSeedOracle.csproj → 0 errors
  • dotnet build src/BalatroSeedOracle.Desktop/... → C# compiles 0 errors; only the Avalonia Accelerate license HTTP call fails in the CI sandbox (no internet to validate WebView / TreeDataGrid / Markdown). On a dev machine with network access the Desktop links and launches.

Known follow-ups (next PR)

  • Wire JamlSearchBuilder.CreatePlan into the orchestrator so Start() actually runs a search (currently throws / no-ops)
  • Reintroduce a result sink (likely Motely.DataLake.DuckLakeSeedSink) and reconnect ActiveSearchContext.GetResultsPageAsync
  • Re-enable search-restore-on-startup on top of the new sink
  • Remove the temporary bool? Tags / bool? RequireMega widening on SourcesConfig once call sites stop assigning null literals

Test plan

  • dotnet build src/BalatroSeedOracle.Desktop on a machine with internet — license validates, app builds and launches
  • Launch desktop app, confirm main menu renders and modals open (Tools, Filters, Search)
  • Open the JAML editor tab, paste a known filter, hit "Format" — round-trip through YamlDotNet
  • Try "Run search" — expect the orchestrator stub to no-op; verify nothing crashes

https://claude.ai/code/session_01MGxcd6zZLNvNMWVFRAQ6oU


Generated by Claude Code

claude added 3 commits May 13, 2026 18:01
The new MotelyJAML branch deletes Motely.API / Motely.DB / Motely.Orchestration —
strip every BSO file that referenced them so the rest of the migration can land
on a clean base. Submodule now tracks the new MotelyJAML structure (Motely,
Motely.CLI, Motely.DataLake, Motely.TUI, Motely.Tests, Motely.Wasm).

Removed:
 - ApiHostWidget (axaml + code-behind), DesktopApiHostService, IApiHostService,
   ApiHostWidgetViewModel — the in-app HTTP host is gone with Motely.API.
 - SequentialLibraryInitializerService, ISequentialLibraryInitializer,
   RestoreActiveSearchesProviderService, IRestoreActiveSearchesProvider,
   ResultsDatabaseExporter — backed by Motely.DB.SequentialLibrary which is gone.
 - sln entries for Motely.API / Motely.DB / Motely.Orchestration.
 - ProjectReferences to the three dead csprojs from BSO / BSO.Desktop.
 - Duplicate \"MotelyJAML\" submodule stanza in .gitmodules.

Build is still broken: 90 errors remain (MotelyJsonConfig / JsonSearchParams /
SearchOptionsDto were also removed, and BSO leans on them in 27 files). Follow-up
commit will add a compat shim so the UI shell can build.

https://claude.ai/code/session_01MGxcd6zZLNvNMWVFRAQ6oU
…hestrator/API refs

BSO core lib + Desktop now build clean against the new MotelyJAML structure.
The legacy `Motely.Filters.MotelyJsonConfig` API surface is reborn inside BSO as
a slim DTO (no PostProcess pipeline, no MotelyEnumParser) plus a YAML helper
that round-trips with YamlDotNet. The compat seam preserves all 27 BSO call
sites — full JamlConfig migration happens at the search boundary in a follow-up.

New under src/BalatroSeedOracle/Motely/:
 - MotelyJsonConfig + nested MotelyJsonFilterClause + SourcesConfig +
   MotelyFilterDefaults (DTOs only)
 - MotelyJsonSerializerContext (AOT JSON source-gen target)
 - SearchOptionsDto, JsonSearchParams (lifted from upstream Motely)
 - IMotelySearchContext / MotelySearchStatus / MotelySearchResultRow
 - MotelySearchOrchestrator + MultiSearchManager stubs that build a pending
   context but throw on real search (real wiring lands next pass)
 - MotelyJsonConfigYaml (YAML load / serialize for MotelyJsonConfig)
 - JamlConfigLoader compat shim under `Motely` ns mapping the old
   TryLoadFromJamlString / TryLoadFromJaml names

Stripped from BSO:
 - ApiHostWidget references in MainWindowExtensions, BalatroMainMenuViewModel,
   ToolsModal, ModalHelper.
 - SequentialLibrary / RestoreActiveSearches DI in Program.cs and SearchManager
   (the persistence layer disappeared with Motely.DB).
 - DesktopAppExtensions no longer wires MotelyRepository.

Only the Avalonia commercial-license check fails the Desktop link (no internet
in this build sandbox to validate WebView / TreeDataGrid / Markdown). All C#
compiles 0 errors.

https://claude.ai/code/session_01MGxcd6zZLNvNMWVFRAQ6oU
JamlConfigBridge serialises the legacy MotelyJsonConfig to JAML YAML (typed-key
clauses) and feeds it through JamlConfigLoader. Orchestrator now compiles a
JamlSearchPlan, attaches the BSO callback for streamed score tallies, and
exposes the search through a LiveMotelySearchContext. The old "throws at
Start()" stub is gone.

Mapping covers joker / commonJoker / uncommonJoker / rareJoker / legendaryJoker
(souljoker → legendaryJoker), voucher, tarotCard, spectralCard, planetCard,
boss, tag / smallBlindTag / bigBlindTag, standardCard, erratic*, startingDraw,
and / or. Unknown discriminators are skipped (logged) so future clause types
fall through without crashing.

ExportTo is still parked until Motely.DataLake / DuckLakeSeedSink lands.

https://claude.ai/code/session_01MGxcd6zZLNvNMWVFRAQ6oU
@OptimusPi OptimusPi force-pushed the claude/revive-avalonia-app-7W1Mw branch from 50e41e6 to 8361ead Compare May 13, 2026 18:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants