:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.
Python ab-testingai-analyticsanalyticscdpdata-warehouseexperimentsfeature-flagsjavascriptproduct-analyticspythonreactsession-replaysurveystypescriptweb-analytics
chore(cdp): move the remaining cdp helpers into products/cdp (#115445)
Harley Alexander45d6a66335da
diff --git a/posthog/cdp/templates/helpers.py b/posthog/cdp/templates/helpers.pyindex 25b08b159405..863896c65bcd 100644--- a/posthog/cdp/templates/helpers.py+++ b/posthog/cdp/templates/helpers.py@@ -6,11 +6,11 @@ from typing import Any, Optional, castfrom posthog.test.base import APIBaseTest, BaseTestfrom unittest.mock import MagicMock, patch-from posthog.cdp.site_functions import get_transpiled_functionfrom posthog.cdp.templates.hog_function_template import HogFunctionTemplateDC, sync_template_to_dbfrom posthog.models.utils import uuid7from products.cdp.backend.models.hog_functions.hog_function import HogFunction+from products.cdp.backend.site_functions import get_transpiled_functionfrom products.cdp.backend.validation import compile_hogfrom common.hogvm.python.execute import execute_bytecode@@ -192,7 +192,7 @@ class BaseSiteDestinationFunctionTest(APIBaseTest):payload = edit_payload(payload)# Mock the transpile function to avoid Node.js/pnpm dependency- with patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile):+ with patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile):response = self.client.post(f"/api/projects/{self.team.id}/hog_functions/",data=payload,diff --git a/posthog/egress/logodev/README.md b/posthog/egress/logodev/README.mdindex 050b6c381b55..14eca8793691 100644--- a/posthog/egress/logodev/README.md+++ b/posthog/egress/logodev/README.md@@ -13,13 +13,13 @@ logo.dev limits requests per month by plan, not per minute or per hour, so the b- `LOGODEV_EGRESS_HOURLY_BUDGET` (default 5,000) caps total spend.Icon bytes are never stored server-side, because logo.dev licenses that separately.-Browser caching (`posthog/cdp/services/icons.py` sets `Cache-Control`) is the only dedupe, so steady-state traffic tracks unique (user, icon) first views per day.+Browser caching (`products/cdp/backend/services/icons.py` sets `Cache-Control`) is the only dedupe, so steady-state traffic tracks unique (user, icon) first views per day.Raise the settings if that outgrows the defaults.## Lanes and callersThe default reserve ladder applies.-The CDP icon picker and MCP store icons (`posthog/cdp/services/icons.py`, source `cdp_icons`) call on the `NORMAL` lane.+The CDP icon picker and MCP store icons (`products/cdp/backend/services/icons.py`, source `cdp_icons`) call on the `NORMAL` lane.Nothing in this domain runs `CRITICAL`, because the icon id is user-controlled and a never-shed lane would make the budget advisory.A denied call raises `LogoDevEgressBudgetExhausted`, and the caller degrades to no icon.diff --git a/posthog/egress/logodev/limiter.py b/posthog/egress/logodev/limiter.pyindex dc9f286ee008..42d7a69727c4 100644--- a/posthog/egress/logodev/limiter.py+++ b/posthog/egress/logodev/limiter.py@@ -5,7 +5,7 @@ credentials from that account, so the whole instance draws from a single sharedconstant scope. logo.dev limits requests per month by plan, with no per-minute or hourly limit, sothe defaults are deliberately modest operator ceilings. Icon bytes are never stored server-side (logo.dev gates that behind adata-caching license), so upstream volume is deduped only per user, by the browser caching that-:mod:`posthog.cdp.services.icons` directs — steady-state traffic tracks unique (user, icon) first+:mod:`products.cdp.backend.services.icons` directs — steady-state traffic tracks unique (user, icon) firstviews per day. Raise the settings below if that outgrows the defaults.Importing this module registers the policy as a side effect — import it (directly or viadiff --git a/posthog/management/commands/migrate_legacy_destinations_to_hog_functions.py b/posthog/management/commands/migrate_legacy_destinations_to_hog_functions.pyindex 0fe4de4b4e38..76b38f5dc62d 100644--- a/posthog/management/commands/migrate_legacy_destinations_to_hog_functions.py+++ b/posthog/management/commands/migrate_legacy_destinations_to_hog_functions.py@@ -2,7 +2,10 @@ from typing import Anyfrom django.core.management.base import BaseCommand-from posthog.cdp.legacy_destination_migration import disable_migrated_plugin_configs, migrate_legacy_destinations+from products.cdp.backend.legacy_destination_migration import (+ disable_migrated_plugin_configs,+ migrate_legacy_destinations,+)def _int_list(value: str | None) -> list[int] | None:diff --git a/posthog/management/commands/migrate_plugins_to_hog_functions.py b/posthog/management/commands/migrate_plugins_to_hog_functions.pyindex 42b3428b9852..52bc45b8ca08 100644--- a/posthog/management/commands/migrate_plugins_to_hog_functions.py+++ b/posthog/management/commands/migrate_plugins_to_hog_functions.py@@ -1,6 +1,6 @@from django.core.management.base import BaseCommand-from posthog.cdp.migrations import migrate_legacy_plugins+from products.cdp.backend.plugin_migrations import migrate_legacy_pluginsclass Command(BaseCommand):diff --git a/posthog/models/remote_config.py b/posthog/models/remote_config.pyindex 0e684b8d735a..f530183ae5ba 100644--- a/posthog/models/remote_config.py+++ b/posthog/models/remote_config.py@@ -357,10 +357,10 @@ class RemoteConfig(UUIDTModel):def _build_site_apps_js(self):# NOTE: This is the web focused config for the frontend that includes site apps- from posthog.cdp.site_functions import exposed_secret_input_keys, get_transpiled_functionfrom posthog.plugins.site import get_site_apps_for_team, get_site_config_from_schemafrom products.cdp.backend.models.hog_functions.hog_function import HogFunction+ from products.cdp.backend.site_functions import exposed_secret_input_keys, get_transpiled_function# Add in the site apps as an array of objectssite_apps_js = []diff --git a/posthog/models/test/test_remote_config.py b/posthog/models/test/test_remote_config.pyindex a1c0b480442c..bc2bf4476deb 100644--- a/posthog/models/test/test_remote_config.py+++ b/posthog/models/test/test_remote_config.py@@ -423,7 +423,7 @@ class TestRemoteConfig(_RemoteConfigBase):assert (function.inputs or {}) == {}assert (function.encrypted_inputs or {})["token"]["value"] == "example-private-browser-value"- with patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile):+ with patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile):result = "".join(self.remote_config._build_site_apps_js())assert str(function.id) in result@@ -458,7 +458,7 @@ class TestRemoteConfig(_RemoteConfigBase):unsafe.refresh_from_db()safe = HogFunction.objects.create(team=self.team, type="site_destination", enabled=True, hog=SITE_HOG)- with patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile):+ with patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile):result = "".join(self.remote_config._build_site_apps_js())assert str(unsafe.id) not in result@@ -506,7 +506,7 @@ class TestRemoteConfig(_RemoteConfigBase):mappings=list(mappings),)- with patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile):+ with patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile):result = "".join(self.remote_config._build_site_apps_js())assert str(function.id) in resultdiff --git a/products/cdp/backend/api/hog_function.py b/products/cdp/backend/api/hog_function.pyindex e8dce3d577d9..0b7c72d6b637 100644--- a/products/cdp/backend/api/hog_function.py+++ b/products/cdp/backend/api/hog_function.py@@ -28,8 +28,6 @@ from posthog.api.log_entries import LogEntryMixinfrom posthog.api.routing import TeamAndOrgViewSetMixinfrom posthog.api.shared import SearchMatchTypeSerializerMixin, UserBasicSerializerfrom posthog.api.utils import action, log_activity_from_viewset-from posthog.cdp.services.icons import CDPIconsService-from posthog.cdp.site_functions import get_transpiled_functionfrom posthog.event_usage import AGENT_EVENT_SOURCES, get_event_sourcefrom posthog.exceptions_capture import capture_exceptionfrom posthog.helpers.impersonation import is_impersonated@@ -70,6 +68,8 @@ from products.cdp.backend.presentation.hog_invocations.rerun import (HogInvocationRerunRequestSerializer,HogInvocationRerunResponseSerializer,)+from products.cdp.backend.services.icons import CDPIconsService+from products.cdp.backend.site_functions import get_transpiled_functionfrom products.cdp.backend.validation import (DUPLICATE_INPUT_KEYS_ERROR,HogFunctionFiltersSerializer,diff --git a/products/cdp/backend/api/hog_function_template.py b/products/cdp/backend/api/hog_function_template.pyindex 13d8230d82a4..732fa5afce5e 100644--- a/products/cdp/backend/api/hog_function_template.py+++ b/products/cdp/backend/api/hog_function_template.py@@ -10,11 +10,11 @@ from rest_framework.exceptions import NotFoundfrom rest_framework.request import Requestfrom posthog.auth import OAuthAccessTokenAuthentication, PersonalAPIKeyAuthentication, SessionAuthentication-from posthog.cdp.flag_gated_templates import FLAG_GATED_TEMPLATE_IDS, hidden_gated_template_idsfrom posthog.models.team import Teamfrom posthog.models.user import Userfrom posthog.permissions import APIScopePermission+from products.cdp.backend.flag_gated_templates import FLAG_GATED_TEMPLATE_IDS, hidden_gated_template_idsfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions import HogFunctiondiff --git a/products/cdp/backend/api/plugin.py b/products/cdp/backend/api/plugin.pyindex 451af80d5c5c..89bde4e43ead 100644--- a/products/cdp/backend/api/plugin.py+++ b/products/cdp/backend/api/plugin.py@@ -717,9 +717,10 @@ class PluginConfigSerializer(serializers.ModelSerializer):validated_data["web_token"] = generate_random_token()# Try and create a hog function if possible, otherwise create plugin- from posthog.cdp.legacy_plugins import hog_function_from_plugin_configfrom posthog.event_usage import report_team_action+ from products.cdp.backend.legacy_plugins import hog_function_from_plugin_config+report_team_action(self.context["get_team"](),"plugin config create called",diff --git a/products/cdp/backend/api/test/test_hog_function.py b/products/cdp/backend/api/test/test_hog_function.pyindex 7d0bb0d53a27..45f24c892c74 100644--- a/products/cdp/backend/api/test/test_hog_function.py+++ b/products/cdp/backend/api/test/test_hog_function.py@@ -2177,7 +2177,7 @@ class TestHogFunctionAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):assert response.status_code == status.HTTP_201_CREATED, response.json()assert response.json()["filters"]["source"] == "data-warehouse-view"- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_create_hog_function_with_site_app_type(self, mock_transpile_fn):response = self.client.post(f"/api/projects/{self.team.id}/hog_functions/",@@ -2192,7 +2192,7 @@ class TestHogFunctionAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):assert response.json()["bytecode"] is Noneassert "Hello, site_app" in response.json()["transpiled"]- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_create_hog_function_with_site_destination_type(self, mock_transpile_fn):response = self.client.post(f"/api/projects/{self.team.id}/hog_functions/",@@ -2331,7 +2331,7 @@ class TestHogFunctionAPI(ClickhouseTestMixin, APIBaseTest, QueryMatchingTest):assert "detail" in response.json()assert "Error in TypeScript code" in response.json()["detail"]- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_create_typescript_destination_with_inputs(self, mock_transpile_fn):payload = {"name": "TypeScript Destination Function",diff --git a/products/cdp/backend/api/test/test_hog_function_drafts.py b/products/cdp/backend/api/test/test_hog_function_drafts.pyindex f1433e168288..a7f1493499fb 100644--- a/products/cdp/backend/api/test/test_hog_function_drafts.py+++ b/products/cdp/backend/api/test/test_hog_function_drafts.py@@ -370,7 +370,7 @@ class TestHogFunctionDrafts(DraftTestCase):assert all(change["after"] == "masked" for change in changes)assert all("private-input" not in str(log.detail) for log in logs)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_site_function_transpiled_output_is_not_written_to_activity_logs(self, _mock_transpile) -> None:function_id = self._create(type="site_destination",diff --git a/products/cdp/backend/api/test/test_hog_function_templates.py b/products/cdp/backend/api/test/test_hog_function_templates.pyindex 7ea284ba6ea4..1fa7bcc7cfe2 100644--- a/products/cdp/backend/api/test/test_hog_function_templates.py+++ b/products/cdp/backend/api/test/test_hog_function_templates.py@@ -348,7 +348,7 @@ class TestHogFunctionTemplates(ClickhouseTestMixin, APIBaseTest, QueryMatchingTefree=True,)- with patch("posthog.cdp.flag_gated_templates.gated_template_enabled", return_value=flag_enabled):+ with patch("products.cdp.backend.flag_gated_templates.gated_template_enabled", return_value=flag_enabled):response = self.client.get(f"/api/projects/{self.team.id}/hog_function_templates/")assert response.status_code == status.HTTP_200_OK, response.json()diff --git a/products/cdp/backend/facade/api.py b/products/cdp/backend/facade/api.pyindex d44d393fbc9f..2b2de23d601c 100644--- a/products/cdp/backend/facade/api.py+++ b/products/cdp/backend/facade/api.py@@ -11,10 +11,10 @@ from collections.abc import Sequencefrom typing import Anyfrom uuid import UUID-from posthog.cdp.flag_gated_templates import FLAG_GATED_TEMPLATE_IDS, gated_template_enabledfrom posthog.models.team import Teamfrom posthog.models.user import User+from products.cdp.backend.flag_gated_templates import FLAG_GATED_TEMPLATE_IDS, gated_template_enabledfrom products.cdp.backend.models.hog_function_template import HogFunctionTemplate_B = "products.cdp.backend."diff --git a/posthog/cdp/flag_gated_templates.py b/products/cdp/backend/flag_gated_templates.pysimilarity index 100%rename from posthog/cdp/flag_gated_templates.pyrename to products/cdp/backend/flag_gated_templates.pydiff --git a/posthog/cdp/legacy_destination_migration.py b/products/cdp/backend/legacy_destination_migration.pysimilarity index 100%rename from posthog/cdp/legacy_destination_migration.pyrename to products/cdp/backend/legacy_destination_migration.pydiff --git a/posthog/cdp/legacy_plugins.py b/products/cdp/backend/legacy_plugins.pysimilarity index 100%rename from posthog/cdp/legacy_plugins.pyrename to products/cdp/backend/legacy_plugins.pydiff --git a/posthog/cdp/migrations.py b/products/cdp/backend/plugin_migrations.pysimilarity index 100%rename from posthog/cdp/migrations.pyrename to products/cdp/backend/plugin_migrations.pydiff --git a/products/cdp/backend/presentation/hog_functions.py b/products/cdp/backend/presentation/hog_functions.pyindex f54ceb48328f..ca7de9183255 100644--- a/products/cdp/backend/presentation/hog_functions.py+++ b/products/cdp/backend/presentation/hog_functions.py@@ -5,15 +5,14 @@ the helpers that workflows and messaging views use cross here. Their signaturesreturn untyped bytecode, so they cannot cross through the facade."""-from posthog.cdp.flag_gated_templates import (- FLAG_GATED_TEMPLATE_IDS as FLAG_GATED_TEMPLATE_IDS,- gated_template_enabled as gated_template_enabled,-)-from products.cdp.backend.filters import (DATA_WAREHOUSE_SOURCES as DATA_WAREHOUSE_SOURCES,compile_filters_expr as compile_filters_expr,)+from products.cdp.backend.flag_gated_templates import (+ FLAG_GATED_TEMPLATE_IDS as FLAG_GATED_TEMPLATE_IDS,+ gated_template_enabled as gated_template_enabled,+)from products.cdp.backend.validation import (build_html_wrap_design as build_html_wrap_design,generate_template_bytecode as generate_template_bytecode,diff --git a/products/cdp/backend/presentation/icons.py b/products/cdp/backend/presentation/icons.pyindex 79706e32c21b..0671df06e6e2 100644--- a/products/cdp/backend/presentation/icons.py+++ b/products/cdp/backend/presentation/icons.py@@ -1,3 +1,3 @@"""The destination icon service that other products' icon endpoints serve through."""-from posthog.cdp.services.icons import CDPIconsService as CDPIconsService+from products.cdp.backend.services.icons import CDPIconsService as CDPIconsServicediff --git a/posthog/cdp/services/icons.py b/products/cdp/backend/services/icons.pysimilarity index 100%rename from posthog/cdp/services/icons.pyrename to products/cdp/backend/services/icons.pydiff --git a/posthog/cdp/site_functions.py b/products/cdp/backend/site_functions.pysimilarity index 100%rename from posthog/cdp/site_functions.pyrename to products/cdp/backend/site_functions.pydiff --git a/posthog/cdp/test/__snapshots__/test_site_functions.ambr b/products/cdp/backend/test/__snapshots__/test_site_functions.ambrsimilarity index 100%rename from posthog/cdp/test/__snapshots__/test_site_functions.ambrrename to products/cdp/backend/test/__snapshots__/test_site_functions.ambrdiff --git a/posthog/cdp/test/test_icons.py b/products/cdp/backend/test/test_icons.pysimilarity index 98%rename from posthog/cdp/test/test_icons.pyrename to products/cdp/backend/test/test_icons.pyindex ba756a99f334..3f6644ae5d4a 100644--- a/posthog/cdp/test/test_icons.py+++ b/products/cdp/backend/test/test_icons.py@@ -13,9 +13,10 @@ from requests.structures import CaseInsensitiveDictfrom rest_framework import statusfrom rest_framework.exceptions import APIException, NotFound-from posthog.cdp.services.icons import CDPIconsService, LogoDevBadGateway, LogoDevUnavailablefrom posthog.egress.limiter.outbound import get_outbound_rate_limiter+from products.cdp.backend.services.icons import CDPIconsService, LogoDevBadGateway, LogoDevUnavailable+# Fresh team id per test (and per run) so consuming the real per-team budget never accumulates# into a denial across tests or repeated local runs against a persistent Redis._TEAM_IDS = count(time.time_ns() % 1_000_000_000)@@ -308,7 +309,7 @@ class TestCDPIconsService(SimpleTestCase):# arbitrary-domain requests from blanking icons for every other team. Denial must be# charged to the calling team's own key, stay uncached, and never reach upstream.with (- patch("posthog.cdp.services.icons.get_outbound_rate_limiter") as limiter,+ patch("products.cdp.backend.services.icons.get_outbound_rate_limiter") as limiter,patch("requests.request") as upstream,):limiter.return_value.consume_sync.return_value = False@@ -358,7 +359,7 @@ class TestCDPIconsService(SimpleTestCase):# Search queries are free text — the same per-team gate must cover them or a team could# drain the shared account budget through the search path instead.with (- patch("posthog.cdp.services.icons.get_outbound_rate_limiter") as limiter,+ patch("products.cdp.backend.services.icons.get_outbound_rate_limiter") as limiter,patch("requests.request") as upstream,):limiter.return_value.consume_sync.return_value = Falsediff --git a/posthog/cdp/test/test_legacy_destination_migration.py b/products/cdp/backend/test/test_legacy_destination_migration.pysimilarity index 98%rename from posthog/cdp/test/test_legacy_destination_migration.pyrename to products/cdp/backend/test/test_legacy_destination_migration.pyindex c48526061989..687a5fc05f92 100644--- a/posthog/cdp/test/test_legacy_destination_migration.py+++ b/products/cdp/backend/test/test_legacy_destination_migration.py@@ -1,7 +1,9 @@from posthog.test.base import BaseTest-from posthog.cdp.legacy_destination_migration import disable_migrated_plugin_configs, migrate_legacy_destinations-+from products.cdp.backend.legacy_destination_migration import (+ disable_migrated_plugin_configs,+ migrate_legacy_destinations,+)from products.cdp.backend.models.hog_function_template import HogFunctionTemplatefrom products.cdp.backend.models.hog_functions.hog_function import HogFunction, HogFunctionTypefrom products.cdp.backend.models.plugin import Plugin, PluginAttachment, PluginConfigdiff --git a/posthog/cdp/test/test_migrations.py b/products/cdp/backend/test/test_plugin_migrations.pysimilarity index 92%rename from posthog/cdp/test/test_migrations.pyrename to products/cdp/backend/test/test_plugin_migrations.pyindex 0bbee694d09d..0933eabc3c0b 100644--- a/posthog/cdp/test/test_migrations.py+++ b/products/cdp/backend/test/test_plugin_migrations.py@@ -7,7 +7,6 @@ from django.test import SimpleTestCasefrom parameterized import parameterized-from posthog.cdp.migrations import coerce_input_value, migrate_legacy_pluginsfrom posthog.cdp.templates._siteapps.template_notification_bar import template as notification_barfrom posthog.cdp.templates._siteapps.template_pineapple_mode import template as pineapple_modefrom posthog.cdp.templates.helpers import mock_transpile@@ -15,6 +14,7 @@ from posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.plugin import Plugin, PluginConfig, PluginSourceFile+from products.cdp.backend.plugin_migrations import coerce_input_value, migrate_legacy_pluginsclass TestCoerceInputValue(SimpleTestCase):@@ -78,7 +78,7 @@ class TestMigrateSiteApps(BaseTest):web_token=f"token-{name}",)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_migrates_site_app_plugin_to_hog_function(self, mock_transpile_fn):migrate_legacy_plugins(dry_run=False, test_mode=False, kind="site_app")@@ -99,7 +99,7 @@ class TestMigrateSiteApps(BaseTest):self.plugin_config.refresh_from_db()assert not self.plugin_config.enabled- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_migrates_notification_bar_custom_css(self, mock_transpile_fn):css = ".notification-bar { font-size: 16px }"notification_bar_config = self._create_site_app(@@ -118,7 +118,7 @@ class TestMigrateSiteApps(BaseTest):notification_bar_config.refresh_from_db()assert not notification_bar_config.enabled- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_leaves_a_site_app_with_no_template_enabled(self, mock_transpile_fn):# Disabling one of these would take it off the customer's site with nothing to replace itunsupported = self._create_site_app(@@ -136,7 +136,7 @@ class TestMigrateSiteApps(BaseTest):self.plugin_config.refresh_from_db()assert not self.plugin_config.enabled- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_disables_a_second_config_of_an_app_already_covered(self, mock_transpile_fn):# Teams do run the same site app twice. The second one is replaced by the hog function the# first produced, so leaving it enabled would render the app twice.@@ -157,7 +157,7 @@ class TestMigrateSiteApps(BaseTest):assert not second.enabledassert not self.plugin_config.enabled- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_migration_is_idempotent(self, mock_transpile_fn):migrate_legacy_plugins(dry_run=False, test_mode=False, kind="site_app")PluginConfig.objects.filter(id=self.plugin_config.id).update(enabled=True)diff --git a/posthog/cdp/test/test_site_functions.py b/products/cdp/backend/test/test_site_functions.pysimilarity index 90%rename from posthog/cdp/test/test_site_functions.pyrename to products/cdp/backend/test/test_site_functions.pyindex ac436046611d..c6170eced714 100644--- a/posthog/cdp/test/test_site_functions.py+++ b/products/cdp/backend/test/test_site_functions.py@@ -10,7 +10,6 @@ from django.test import TestCasefrom parameterized import parameterized-from posthog.cdp.site_functions import get_transpiled_functionfrom posthog.cdp.templates.helpers import mock_transpilefrom posthog.models.organization import Organizationfrom posthog.models.project import Project@@ -20,6 +19,7 @@ from posthog.test.test_utils import create_group_type_mapping_without_created_atfrom products.actions.backend.models.action import Actionfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cdp.backend.models.plugin import TranspilerError+from products.cdp.backend.site_functions import get_transpiled_functionfrom products.cohorts.backend.models.cohort import Cohort@@ -64,7 +64,7 @@ class TestSiteFunctions(TestCase):f.flush()return subprocess.check_output(["node", f.name]).decode("utf-8")- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_basic(self, mock_transpile_fn):result = self.compile_and_run()assert isinstance(result, str)@@ -73,7 +73,7 @@ class TestSiteFunctions(TestCase):# This ensures the transpilation logic remains stable and any changes are intentionalself.snapshot.assert_match(result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_static_input(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.message); }"self.hog_function.inputs = {"message": {"value": "Hello, Inputs!"}}@@ -81,14 +81,14 @@ class TestSiteFunctions(TestCase):result = self.compile_and_run()self.snapshot.assert_match(result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_template_input(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.greeting); }"self.hog_function.inputs = {"greeting": {"value": "Hello, {person.properties.name}!"}}result = self.compile_and_run()self.snapshot.assert_match(result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_filters(self, mock_transpile_fn):self.hog_function.hog = "export function onEvent(globals) { console.log(globals); }"self.hog_function.filters = {"events": [{"id": "$pageview", "name": "$pageview", "type": "events", "order": 0}]}@@ -96,7 +96,7 @@ class TestSiteFunctions(TestCase):result = self.compile_and_run()self.snapshot.assert_match(result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_invalid_template_input(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.greeting); }"self.hog_function.inputs = {"greeting": {"value": "Hello, {person.properties.nonexistent_property}!"}}@@ -111,7 +111,7 @@ class TestSiteFunctions(TestCase):with pytest.raises(TranspilerError):get_transpiled_function(self.hog_function)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_complex_inputs(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.complexInput); }"self.hog_function.inputs = {@@ -126,7 +126,7 @@ class TestSiteFunctions(TestCase):result = self.compile_and_run()self.snapshot.assert_match(result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_empty_inputs(self, mock_transpile_fn):self.hog_function.hog = 'export function onLoad() { console.log("No inputs"); }'self.hog_function.inputs = {}@@ -136,7 +136,7 @@ class TestSiteFunctions(TestCase):assert 'console.log("No inputs");' in resultassert "let inputs = {\n};" in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_non_template_string(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.staticMessage); }"self.hog_function.inputs = {"staticMessage": {"value": "This is a static message."}}@@ -147,7 +147,7 @@ class TestSiteFunctions(TestCase):assert '"staticMessage": "This is a static message."' in resultassert "function getInputsKey" not in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_templating_disabled(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.cssOverride); }"self.hog_function.inputs_schema = [{"key": "cssOverride", "type": "string", "templating": False}]@@ -158,7 +158,7 @@ class TestSiteFunctions(TestCase):assert '"cssOverride": ".bar { color: red }"' in resultassert "function getInputsKey" not in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_templating_disabled_on_a_list(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.notices); }"self.hog_function.inputs_schema = [{"key": "notices", "type": "json", "templating": False}]@@ -169,7 +169,7 @@ class TestSiteFunctions(TestCase):# Only strings opt out of templating, so a structured value still compilesassert "function getInputsKey" in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_list_inputs(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.messages); }"self.hog_function.inputs = {"messages": {"value": ["Hello", "World", "{person.properties.name}"]}}@@ -180,7 +180,7 @@ class TestSiteFunctions(TestCase):assert "function getInputsKey" in resultassert 'inputs["messages"] = getInputsKey("messages");' in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_event_filter(self, mock_transpile_fn):self.hog_function.hog = "export function onEvent(event) { console.log(event.properties.url); }"self.hog_function.filters = {@@ -203,7 +203,7 @@ class TestSiteFunctions(TestCase):in result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_groups(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.groupInfo); }"self.hog_function.inputs = {"groupInfo": {"value": "{groups['company']}"}}@@ -218,7 +218,7 @@ class TestSiteFunctions(TestCase):assert 'inputs["groupInfo"] = getInputsKey("groupInfo");' in resultassert '__getProperty(__getGlobal("groups"), "company", false)' in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_missing_group(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs.groupInfo); }"self.hog_function.inputs = {"groupInfo": {"value": "{groups['nonexistent']}"}}@@ -229,7 +229,7 @@ class TestSiteFunctions(TestCase):assert 'inputs["groupInfo"] = getInputsKey("groupInfo");' in resultassert '__getProperty(__getGlobal("groups"), "nonexistent"' in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_complex_filters(self, mock_transpile_fn):action = Action.objects.create(team=self.team, name="Test Action")action.steps = [{"event": "$pageview", "url": "https://example.com"}]@@ -255,7 +255,7 @@ class TestSiteFunctions(TestCase):assert '__getGlobal("event") == "$pageview"' in resultassert "https://example.com" in result- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_person_property_cohort_filter_inlined(self, mock_transpile_fn):cohort = Cohort.objects.create(team=self.team,@@ -333,7 +333,7 @@ class TestSiteFunctions(TestCase):),])- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_unsupported_cohort_raises_error(self, _name, is_static, filters, mock_transpile_fn):@@ -358,7 +358,7 @@ class TestSiteFunctions(TestCase):with pytest.raises(Exception, match="cohort"):get_transpiled_function(self.hog_function)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_mappings(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad({ inputs, posthog }) { console.log(inputs); }"self.hog_function.inputs = {"greeting": {"value": "Hello, {person.properties.nonexistent_property}!"}}@@ -375,7 +375,7 @@ class TestSiteFunctions(TestCase):result = self.compile_and_run()self.snapshot.assert_match(result)- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_run_function_onload(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad({ inputs, posthog }) { console.log(inputs.message); }"self.hog_function.filters = {"events": [{"id": "$pageview", "name": "$pageview", "type": "events", "order": 0}]}@@ -390,7 +390,7 @@ class TestSiteFunctions(TestCase):)assert "Hello World Bob\nLoaded" == response.strip()- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_run_function_onevent(self, mock_transpile_fn):self.hog_function.hog = "export function onEvent({ inputs }) { console.log(inputs.message); }"# self.hog_function.filters = {"events": [{"id": "$pageview", "name": "$pageview", "type": "events", "order": 0}]}@@ -431,7 +431,7 @@ class TestSiteFunctions(TestCase):)assert "Loaded" == response.strip()- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_run_function_skip_disabled_mapping(self, mock_transpile_fn):self.hog_function.hog = "export function onEvent({ inputs }) { console.log(inputs.message); }"self.hog_function.inputs = {"message": {"value": "Hello World {event.properties.id}"}}@@ -459,7 +459,7 @@ class TestSiteFunctions(TestCase):)assert "Loaded" == response.strip()- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_ordered_inputs(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs); }"self.hog_function.inputs = {@@ -477,7 +477,7 @@ class TestSiteFunctions(TestCase):assert idx_first < idx_second < idx_third- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_without_order(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs); }"self.hog_function.inputs = {@@ -494,7 +494,7 @@ class TestSiteFunctions(TestCase):assert idx_noOrder < idx_alsoNoOrder < idx_withOrder- @patch("posthog.cdp.site_functions.transpile", side_effect=mock_transpile)+ @patch("products.cdp.backend.site_functions.transpile", side_effect=mock_transpile)def test_get_transpiled_function_with_duplicate_orders(self, mock_transpile_fn):self.hog_function.hog = "export function onLoad() { console.log(inputs); }"self.hog_function.inputs = {diff --git a/posthog/cdp/test/test_workflow_step_resume.py b/products/cdp/backend/test/test_workflow_step_resume.pysimilarity index 96%rename from posthog/cdp/test/test_workflow_step_resume.pyrename to products/cdp/backend/test/test_workflow_step_resume.pyindex 7797a64cde4b..086786482e89 100644--- a/posthog/cdp/test/test_workflow_step_resume.py+++ b/products/cdp/backend/test/test_workflow_step_resume.py@@ -9,9 +9,9 @@ from django.test import override_settingsimport jwtimport requests-from posthog.cdp.workflow_step_resume import RESULT_BYTE_CAP, RESULT_STRING_CAP, emit_workflow_step_resume+from products.cdp.backend.workflow_step_resume import RESULT_BYTE_CAP, RESULT_STRING_CAP, emit_workflow_step_resume-_PRODUCE = "posthog.cdp.workflow_step_resume.produce_internal_event"+_PRODUCE = "products.cdp.backend.workflow_step_resume.produce_internal_event"_POST = "posthog.plugins.plugin_server_api.internal_requests.post"diff --git a/posthog/cdp/workflow_step_resume.py b/products/cdp/backend/workflow_step_resume.pysimilarity index 100%rename from posthog/cdp/workflow_step_resume.pyrename to products/cdp/backend/workflow_step_resume.pydiff --git a/products/signals/backend/temporal/agentic/scout_scheduler.py b/products/signals/backend/temporal/agentic/scout_scheduler.pyindex 8466a0dcb7d5..1e5ef9d77de5 100644--- a/products/signals/backend/temporal/agentic/scout_scheduler.py+++ b/products/signals/backend/temporal/agentic/scout_scheduler.py@@ -16,7 +16,6 @@ from temporalio.client import Clientfrom temporalio.common import RetryPolicy, WorkflowIDConflictPolicy, WorkflowIDReusePolicyfrom temporalio.exceptions import ActivityError, ApplicationError, WorkflowAlreadyStartedError, is_cancelled_exception-from posthog.cdp.workflow_step_resume import WorkflowStepResumeStatus, emit_workflow_step_resumefrom posthog.clickhouse.query_tagging import private_capture_contextfrom posthog.dataclasses import frozenfrom posthog.models import Team@@ -24,6 +23,7 @@ from posthog.sync import database_sync_to_asyncfrom posthog.temporal.common.heartbeat import Heartbeaterfrom posthog.temporal.common.utils import close_db_connections+from products.cdp.backend.workflow_step_resume import WorkflowStepResumeStatus, emit_workflow_step_resumefrom products.signals.backend.daily_limit import capture_signal_report_daily_limit_paused, daily_report_limit_gatefrom products.signals.backend.quota import (capture_signal_report_quota_paused,diff --git a/products/tasks/backend/logic/services/workflow_step_resume.py b/products/tasks/backend/logic/services/workflow_step_resume.pyindex f80d7f3fb5f2..4309e4d8b84d 100644--- a/products/tasks/backend/logic/services/workflow_step_resume.py+++ b/products/tasks/backend/logic/services/workflow_step_resume.py@@ -3,13 +3,12 @@ from uuid import UUIDfrom celery import current_app-from posthog.cdp.workflow_step_resume import (+from products.cdp.backend.workflow_step_resume import (RESULT_BYTE_CAP,WorkflowStepResumeStatus,cap_value,emit_workflow_step_resume,)-from products.tasks.backend.logic.services.workflow_task_output import RUN_OUTPUT_RESERVED_KEYSfrom products.tasks.backend.models import Task, TaskRundiff --git a/products/tasks/backend/logic/services/workflow_task_output.py b/products/tasks/backend/logic/services/workflow_task_output.pyindex c702d0325915..0ed5faa5a37b 100644--- a/products/tasks/backend/logic/services/workflow_task_output.py+++ b/products/tasks/backend/logic/services/workflow_task_output.py@@ -4,7 +4,7 @@ import refrom collections.abc import Mappingfrom typing import Any-from posthog.cdp.workflow_step_resume import RESULT_BYTE_CAP, RESULT_STRING_CAP+from products.cdp.backend.workflow_step_resume import RESULT_BYTE_CAP, RESULT_STRING_CAPOUTPUT_FIELD_TYPES = ("string", "number", "boolean")MAX_OUTPUT_FIELDS = 20diff --git a/products/tasks/backend/logic/services/workflow_tasks.py b/products/tasks/backend/logic/services/workflow_tasks.pyindex 419ce14fe97a..a6bab6232327 100644--- a/products/tasks/backend/logic/services/workflow_tasks.py+++ b/products/tasks/backend/logic/services/workflow_tasks.py@@ -16,13 +16,13 @@ from django.utils import timezone as django_timezoneimport structlog-from posthog.cdp.workflow_step_resume import RESULT_STRING_CAPfrom posthog.dataclasses import frozenfrom posthog.models import Userfrom posthog.models.integration import Integration, SlackIntegrationfrom posthog.models.team.team import Teamfrom posthog.temporal.oauth import PosthogMcpScopes+from products.cdp.backend.workflow_step_resume import RESULT_STRING_CAPfrom products.mcp_store.backend.facade.api import resolve_agent_gateway_server_idsfrom products.slack_app.backend.facade.api import slack_artifact_delivery_state_updates, slack_channel_is_approvedfrom products.slack_app.backend.models import SlackThreadTaskMappingdiff --git a/products/tasks/backend/tests/test_workflow_step_resume.py b/products/tasks/backend/tests/test_workflow_step_resume.pyindex 7a6825d9c9e3..b672202fd681 100644--- a/products/tasks/backend/tests/test_workflow_step_resume.py+++ b/products/tasks/backend/tests/test_workflow_step_resume.py@@ -6,8 +6,7 @@ from unittest.mock import patchfrom parameterized import parameterized-from posthog.cdp.workflow_step_resume import RESULT_BYTE_CAP-+from products.cdp.backend.workflow_step_resume import RESULT_BYTE_CAPfrom products.tasks.backend.facade.api import update_task_runfrom products.tasks.backend.logic.services.workflow_step_resume import (DEFERRED_RESUME_TASK,diff --git a/products/tasks/backend/tests/test_workflow_tasks_api.py b/products/tasks/backend/tests/test_workflow_tasks_api.pyindex 3f18324612d1..1a6d22ec2c11 100644--- a/products/tasks/backend/tests/test_workflow_tasks_api.py+++ b/products/tasks/backend/tests/test_workflow_tasks_api.py@@ -15,7 +15,6 @@ from parameterized import parameterizedfrom rest_framework import statusfrom rest_framework.test import APIClient-from posthog.cdp.workflow_step_resume import RESULT_STRING_CAPfrom posthog.jwt import PosthogJwtAudience, encode_jwtfrom posthog.models.integration import Integrationfrom posthog.models.oauth import OAuthAccessToken, OAuthApplication@@ -24,6 +23,7 @@ from posthog.models.scoping import team_scopefrom posthog.models.team.team import Teamfrom posthog.temporal.oauth import ARRAY_APP_CLIENT_ID_DEV+from products.cdp.backend.workflow_step_resume import RESULT_STRING_CAPfrom products.skills.backend.models.skills import LLMSkillfrom products.slack_app.backend.models import SlackChannel, SlackThreadTaskMappingfrom products.tasks.backend.logic.services.workflow_tasks import (diff --git a/products/workflows/backend/presentation/views/workflow_classifications.py b/products/workflows/backend/presentation/views/workflow_classifications.pyindex 793adf2ccd41..f8b9fe633784 100644--- a/products/workflows/backend/presentation/views/workflow_classifications.py+++ b/products/workflows/backend/presentation/views/workflow_classifications.py@@ -13,9 +13,9 @@ from rest_framework.request import Requestfrom rest_framework.response import Responsefrom posthog.auth import InternalAPIUser, ScopedServiceJWTAuthentication-from posthog.cdp.flag_gated_templates import gated_template_enabledfrom posthog.models import Team+from products.cdp.backend.presentation.hog_functions import gated_template_enabledfrom products.ml_inference.backend.facade.contracts import (DEFAULT_DECISION_MODEL,MAX_OPTIONS_PER_QUESTION,diff --git a/products/workflows/backend/tests/api/test_hog_flow.py b/products/workflows/backend/tests/api/test_hog_flow.pyindex 5dd899502411..d7efb9f4e5cb 100644--- a/products/workflows/backend/tests/api/test_hog_flow.py+++ b/products/workflows/backend/tests/api/test_hog_flow.py@@ -17,7 +17,6 @@ from django.utils import timezonefrom parameterized import parameterizedfrom rest_framework import status-from posthog.cdp.flag_gated_templates import gated_template_enabledfrom posthog.cdp.templates.fixtures import template_slackfrom posthog.cdp.templates.hog_function_template import sync_template_to_dbfrom posthog.constants import AvailableFeature@@ -33,6 +32,7 @@ from products.access_control.backend.models.access_control import AccessControlfrom products.actions.backend.models.action import Actionfrom products.cdp.backend.api.test.test_hog_function_templates import MOCK_NODE_TEMPLATESfrom products.cdp.backend.filters import RUNTIME_CONTRACT+from products.cdp.backend.flag_gated_templates import gated_template_enabledfrom products.cdp.backend.models.hog_functions.hog_function import HogFunctionfrom products.cohorts.backend.models.cohort import Cohortfrom products.skills.backend.models.skills import LLMSkill@@ -6530,7 +6530,7 @@ class TestFlagGatedTemplates(APIBaseTest):def test_flag_eval_failure_hides_the_gated_template(self):# A flag-service blip must hide the pre-release step, not expose it.with patch(- "posthog.cdp.flag_gated_templates.posthoganalytics.feature_enabled",+ "products.cdp.backend.flag_gated_templates.posthoganalytics.feature_enabled",side_effect=Exception("flag service down"),):assert gated_template_enabled("workflow-ai-task-action", self.team) is Falsediff --git a/pyproject.toml b/pyproject.tomlindex 5b32289b3527..633ba11b4ebe 100644--- a/pyproject.toml+++ b/pyproject.toml@@ -595,6 +595,8 @@ ignore_imports = ["products.cdp.backend.presentation.hog_functions -> products.cdp.backend.filters","products.cdp.backend.presentation.hog_functions -> products.cdp.backend.validation","products.cdp.backend.presentation.serializers -> products.cdp.backend.validation",+ "products.cdp.backend.presentation.hog_functions -> products.cdp.backend.flag_gated_templates",+ "products.cdp.backend.presentation.icons -> products.cdp.backend.services.icons",# TODO: existing violations — fix by routing through facade"products.alerts.backend.presentation.views.alert -> products.alerts.backend.evaluation.contract","products.alerts.backend.presentation.views.alert -> products.alerts.backend.evaluation.detector",