mirror of
https://github.com/hanzoai/insights.git
synced 2026-10-30 16:15:31 +00:00
experiment_service imported ExperimentToSavedMetricSerializer from presentation.serializers, and presentation.serializers imports ExperimentService straight back, so whichever of the two Python reached first died on a partially initialized module. That is what took web and worker down together on 1.52.85: insights.urls -> rest_router -> the experiments routes -> presentation.views walked into the cycle during Django startup, so neither pod could boot. 1.52.86 broke the edge by deferring the two service-side imports into the methods that use them. That boots, and it is what is serving now, but it leaves a service reaching up into presentation and hides the dependency from every tool that reads the import graph rather than removing it. The serializer was never presentation's to own. It serializes a join row and depends on the model alone, while both layers need it, so it belongs in a module that neither of them owns. presentation/saved_metric.py is that module, and once it exists the deferred imports are unnecessary: presentation -> service is left as the single direction there should ever have been. Checked by importing each end first in a fresh interpreter, since a cycle only shows from the side that closes it. Both ends resolve now, and both reproduce the original ImportError when the service is pointed back at presentation.serializers, so the check can still fail. The presentation test reached for this serializer through ee.datastore.views, which this fork deleted, so it now names the real home.