mirror of
https://github.com/rommapp/romm.git
synced 2026-11-28 17:48:31 +01:00
Both CI failures came from one import cycle. RQ could no longer resolve `endpoints.sockets.scan.scan_platforms`, and the e2e seed script failed the same way, because `sigil` imports the platform slug enum, importing anything under `handler.metadata` runs its `__init__`, that reaches `gamelist_handler` which imports `handler.filesystem`, and `roms_handler` there imports `sigil` back while it is still half-initialised. The cycle predates this branch. It stayed hidden because `scan.py` reached the enum through `utils.switch`, imported late enough that `handler.filesystem` was already loaded; naming the adapter directly moved that import to the top of the module and the ordering luck ran out. So the enum moves to `utils/platform_slugs.py`, which imports nothing but `enum`. Naming a platform no longer drags in httpx, redis and the titledb task, and the 29 call sites point at the module that owns it rather than picking it up from a 1000-line metadata handler that happens to re-export it. `import adapters.services.sigil` now also works on its own, which it did not before. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>