: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
feat(flags): keep a feature flag to one product (#96578)
Yasen79fd0245c4de
diff --git a/products/early_access_features/backend/api.py b/products/early_access_features/backend/api.pyindex 636ef02ccc1e..1c883d0f989f 100644--- a/products/early_access_features/backend/api.py+++ b/products/early_access_features/backend/api.py@@ -38,6 +38,7 @@ from products.feature_flags.backend.encrypted_flag_payloads import REDACTED_PAYLfrom products.feature_flags.backend.facade.api import create_flag, update_flagfrom products.feature_flags.backend.facade.filters import set_feature_enrollmentfrom products.feature_flags.backend.models.feature_flag import FeatureFlag+from products.feature_flags.backend.ownership import FLAG_OWNER_EARLY_ACCESS, assert_flag_available_for, flag_owner_kindfrom .models import EarlyAccessFeature@@ -381,7 +382,7 @@ class EarlyAccessFeatureSerializerCreateOnly(EarlyAccessFeatureSerializer):feature_flag_id = serializers.IntegerField(required=False,write_only=True,- help_text="Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate.",+ help_text="Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not belong to another product such as a survey or experiment, must not be group-based, and must not be multivariate.",)_create_in_folder = serializers.CharField(required=False, allow_blank=True, write_only=True)@@ -434,6 +435,9 @@ class EarlyAccessFeatureSerializerCreateOnly(EarlyAccessFeatureSerializer):f"Linked feature flag {feature_flag.key} already has a feature attached to it.")+ # The check above keeps one feature per flag; this one keeps out other products.+ assert_flag_available_for(feature_flag, product=FLAG_OWNER_EARLY_ACCESS)+if feature_flag.aggregation_group_type_index is not None:raise serializers.ValidationError("Group-based feature flags are not supported for Early Access Features."@@ -461,10 +465,11 @@ class EarlyAccessFeatureSerializerCreateOnly(EarlyAccessFeatureSerializer):).first()if existing_flag is not None:# Linking is only advice worth giving when the flag is actually linkable; the check- # above rejects a flag that already has a feature attached.+ # above rejects a flag that already has a feature attached, or that another+ # product owns.remedy = ("Rename this feature."- if existing_flag.features.exists()+ if flag_owner_kind(existing_flag) is not Noneelse "Rename this feature, or link the existing flag instead.")raise serializers.ValidationError(@@ -493,8 +498,10 @@ class EarlyAccessFeatureSerializerCreateOnly(EarlyAccessFeatureSerializer):if feature_flag_id:feature_flag = FeatureFlag.objects.get(pk=feature_flag_id, team_id=self.context["team_id"])- # Only require feature_flag:write when we actually mutate the linked flag (active- # stage). Linking an existing flag without changing it is not a flag write.+ # Linking claims the flag, which stops other products adopting it, so editor access+ # is required whatever the stage. Only the active stage writes the flag row.+ assert_feature_flag_rbac_access(self.user_access_control, feature_flag=feature_flag)+if validated_data.get("stage") in EarlyAccessFeature.ActiveStage:assert_feature_flag_write_scope(self.context["request"],@@ -503,7 +510,6 @@ class EarlyAccessFeatureSerializerCreateOnly(EarlyAccessFeatureSerializer):team_id=self.context["team_id"],feature_flag_id=feature_flag.id,)- assert_feature_flag_rbac_access(self.user_access_control, feature_flag=feature_flag)update_flag(feature_flag,{"filters": set_feature_enrollment(feature_flag.get_filters(), True)},diff --git a/products/early_access_features/backend/test/test_early_access_feature.py b/products/early_access_features/backend/test/test_early_access_feature.pyindex d0073322b865..4e8260e32709 100644--- a/products/early_access_features/backend/test/test_early_access_feature.py+++ b/products/early_access_features/backend/test/test_early_access_feature.py@@ -420,20 +420,39 @@ class TestEarlyAccessFeature(APIBaseTest):},)+ def test_cant_link_a_flag_another_product_owns(self):+ flag = FeatureFlag.objects.create(+ team=self.team,+ filters={"groups": [{"properties": [], "rollout_percentage": None}]},+ key="owned-by-survey",+ created_by=self.user,+ )+ Survey.objects.create(team=self.team, name="s", type="popover", targeting_flag=flag)++ response = self.client.post(+ f"/api/projects/{self.team.id}/early_access_feature/",+ data={"name": "Poacher", "description": "d", "stage": "beta", "feature_flag_id": flag.id},+ format="json",+ )++ assert response.status_code == status.HTTP_400_BAD_REQUEST, response.json()+ assert "already belongs to a survey" in str(response.json())+@parameterized.expand([- ("linkable_flag", False, "Rename this feature, or link the existing flag instead."),- ("flag_already_attached", True, "Rename this feature."),+ ("linkable_flag", None, "Rename this feature, or link the existing flag instead."),+ ("flag_already_attached", "feature", "Rename this feature."),+ ("flag_owned_by_survey", "survey", "Rename this feature."),])- def test_cant_create_early_access_feature_with_duplicate_key(self, _name, attach_existing_feature, remedy):+ def test_cant_create_early_access_feature_with_duplicate_key(self, _name, existing_owner, remedy):flag = FeatureFlag.objects.create(team=self.team,filters={"groups": [{"properties": [], "rollout_percentage": None}]},key="hick-bondoogling",created_by=self.user,)- if attach_existing_feature:+ if existing_owner == "feature":EarlyAccessFeature.objects.create(team=self.team,name="Hick bondoogling (original)",@@ -441,6 +460,8 @@ class TestEarlyAccessFeature(APIBaseTest):stage="beta",feature_flag=flag,)+ elif existing_owner == "survey":+ Survey.objects.create(team=self.team, name="s", type="popover", targeting_flag=flag)response = self.client.post(f"/api/projects/{self.team.id}/early_access_feature/",diff --git a/products/early_access_features/frontend/generated/api.schemas.ts b/products/early_access_features/frontend/generated/api.schemas.tsindex 3a4d79b16de0..b953779d8eb3 100644--- a/products/early_access_features/frontend/generated/api.schemas.ts+++ b/products/early_access_features/frontend/generated/api.schemas.ts@@ -247,7 +247,7 @@ export interface EarlyAccessFeatureSerializerCreateOnlyApi {* @nullable*/readonly assignee: EarlyAccessFeatureSerializerCreateOnlyApiAssignee- /** Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate. */+ /** Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not belong to another product such as a survey or experiment, must not be group-based, and must not be multivariate. */feature_flag_id?: numberreadonly feature_flag: MinimalFeatureFlagApi_create_in_folder?: stringdiff --git a/products/early_access_features/frontend/generated/api.zod.ts b/products/early_access_features/frontend/generated/api.zod.tsindex a2bc9edbd5fb..9e468d0dd521 100644--- a/products/early_access_features/frontend/generated/api.zod.ts+++ b/products/early_access_features/frontend/generated/api.zod.ts@@ -42,7 +42,7 @@ export const EarlyAccessFeatureCreateBody = /* @__PURE__ */ zod.number().optional().describe(- 'Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate.'+ 'Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not belong to another product such as a survey or experiment, must not be group-based, and must not be multivariate.'),_create_in_folder: zod.string().optional(),})diff --git a/products/experiments/backend/experiment_service.py b/products/experiments/backend/experiment_service.pyindex 69ef94413ac8..9acaf99b32ac 100644--- a/products/experiments/backend/experiment_service.py+++ b/products/experiments/backend/experiment_service.py@@ -104,6 +104,7 @@ from products.feature_flags.backend.facade.filters import (strip_group_cohort_restriction,)from products.feature_flags.backend.models.feature_flag import FeatureFlag, experiment_eligibility_error+from products.feature_flags.backend.ownership import FLAG_OWNER_EXPERIMENT, assert_flag_available_forfrom products.notifications.backend.facade.api import (NotificationData,NotificationType,@@ -1545,6 +1546,9 @@ class ExperimentService:existing_flag = FeatureFlag.objects.filter(key=feature_flag_key, team_id=self.team.id).first()if existing_flag:+ # Not in _validate_existing_flag: launch calls that too, on a flag this experiment+ # already owns.+ assert_flag_available_for(existing_flag, product=FLAG_OWNER_EXPERIMENT)self._validate_existing_flag(existing_flag)variants = existing_flag.variants or list(DEFAULT_VARIANTS)return existing_flag, variantsdiff --git a/products/experiments/backend/test/test_experiment_service.py b/products/experiments/backend/test/test_experiment_service.pyindex 1a31c561eeb5..139ed469a349 100644--- a/products/experiments/backend/test/test_experiment_service.py+++ b/products/experiments/backend/test/test_experiment_service.py@@ -61,6 +61,7 @@ from products.experiments.backend.models.experiment import (from products.experiments.backend.models.team_experiments_config import TeamExperimentsConfigfrom products.feature_flags.backend.facade.api import set_flag_active, update_flagfrom products.feature_flags.backend.models.feature_flag import FeatureFlag+from products.surveys.backend.models import Surveyfrom products.warehouse_sources.backend.facade.models import DataWarehouseCredential, DataWarehouseTable@@ -5877,6 +5878,15 @@ class TestExperimentService(APIBaseTest):updated = service.update_experiment(experiment, {"deleted": True}, allow_unknown_events=True)assert updated.deleted is True+ def test_cannot_adopt_a_flag_another_product_owns(self):+ flag = self._create_flag(key="owned-by-survey")+ Survey.objects.create(team=self.team, name="s", type="popover", targeting_flag=flag)++ with self.assertRaises(ValidationError) as cm:+ self._service().create_experiment(name="Poacher", feature_flag_key="owned-by-survey")++ assert "already belongs to a survey" in str(cm.exception)+def test_clone_regenerates_metric_uuids(self):"""Cloning an experiment must produce metrics with fresh uuids — never shared with the source."""self._create_flag(key="clone-fresh-uuids")diff --git a/products/feature_flags/backend/ownership.py b/products/feature_flags/backend/ownership.pynew file mode 100644index 000000000000..0eafc2de8951--- /dev/null+++ b/products/feature_flags/backend/ownership.py@@ -0,0 +1,72 @@+from typing import TYPE_CHECKING++from rest_framework import serializers++if TYPE_CHECKING:+ from products.feature_flags.backend.models.feature_flag import FeatureFlag++FLAG_OWNER_EXPERIMENT = "experiment"+FLAG_OWNER_SURVEY = "survey"+FLAG_OWNER_PRODUCT_TOUR = "product_tour"+FLAG_OWNER_EARLY_ACCESS = "early_access_feature"++_OWNER_LABELS = {+ FLAG_OWNER_EXPERIMENT: "an experiment",+ FLAG_OWNER_SURVEY: "a survey",+ FLAG_OWNER_PRODUCT_TOUR: "a product tour",+ FLAG_OWNER_EARLY_ACCESS: "an early access feature",+}++# `linked_flag` is absent on purpose: a survey or product tour may point at another product's flag+# to target its audience, which references the flag without owning it.+#+# The third element names the manager to read the relation through, or None for the default one.+# Django builds a reverse accessor from the related model's default manager, and+# `ProductTour.objects` hides archived tours. An archived tour keeps its `internal_targeting_flag`,+# so the default manager would report that flag as free while a tour still holds it, and+# unarchiving the tour would then produce the second owner this module exists to prevent.+_OWNING_ACCESSORS: tuple[tuple[str, str, str | None], ...] = (+ ("experiment_set", FLAG_OWNER_EXPERIMENT, None),+ ("surveys_targeting_flag", FLAG_OWNER_SURVEY, None),+ ("surveys_internal_targeting_flag", FLAG_OWNER_SURVEY, None),+ ("surveys_internal_response_sampling_flag", FLAG_OWNER_SURVEY, None),+ ("product_tours_internal_targeting_flag", FLAG_OWNER_PRODUCT_TOUR, "all_objects"),+ ("features", FLAG_OWNER_EARLY_ACCESS, None),+)+++def flag_owner_kind(flag: "FeatureFlag") -> str | None:+ """Return the product that owns this flag, or None when nothing owns it.++ A flag may be owned by at most one product. `assert_flag_available_for` keeps it that way.+ """+ for accessor, kind, manager in _OWNING_ACCESSORS:+ related = getattr(flag, accessor)+ if manager is not None:+ related = related(manager=manager)+ if related.exists():+ return kind+ return None+++def assert_flag_available_for(flag: "FeatureFlag", *, product: str) -> None:+ """Reject adopting a flag that a different product already owns.++ What must stay unambiguous is the owning *product*, not the owning object. Two experiments+ sharing one flag leave one owner, so this permits it; a product that wants one object per flag+ enforces that itself, as early access features do.++ Call this only when a write points a product at a flag it did not point at before. Re-saving a+ parent that already owns the flag must not raise, so the caller compares the incoming id+ against the stored one first.++ This reads before the caller writes, so two products adopting the same free flag at the same+ moment can both pass. No database constraint can span the four owning tables, so the remaining+ window is accepted rather than locked.+ """+ owner = flag_owner_kind(flag)+ if owner is not None and owner != product:+ raise serializers.ValidationError(+ f"The feature flag {flag.key} already belongs to {_OWNER_LABELS[owner]}. "+ f"Pick a different flag, or edit this one where it is already used."+ )diff --git a/products/feature_flags/backend/test/test_ownership.py b/products/feature_flags/backend/test/test_ownership.pynew file mode 100644index 000000000000..c96e200d3c8f--- /dev/null+++ b/products/feature_flags/backend/test/test_ownership.py@@ -0,0 +1,139 @@+from posthog.test.base import APIBaseTest++from parameterized import parameterized+from rest_framework import serializers++from products.early_access_features.backend.models import EarlyAccessFeature+from products.experiments.backend.models.experiment import Experiment+from products.feature_flags.backend.models.feature_flag import FeatureFlag+from products.feature_flags.backend.ownership import FLAG_OWNER_SURVEY, assert_flag_available_for, flag_owner_kind+from products.product_tours.backend.models import ProductTour+from products.surveys.backend.models import Survey+++class TestFlagOwnership(APIBaseTest):+ def _flag(self, key: str) -> FeatureFlag:+ return FeatureFlag.objects.create(team=self.team, key=key, name=key, created_by=self.user)++ def _own_by_experiment(self, flag: FeatureFlag) -> None:+ Experiment.objects.create(team=self.team, name="exp", feature_flag=flag)++ def _own_by_survey_targeting(self, flag: FeatureFlag) -> None:+ Survey.objects.create(team=self.team, name="s", type="popover", targeting_flag=flag)++ def _own_by_survey_internal(self, flag: FeatureFlag) -> None:+ Survey.objects.create(team=self.team, name="s", type="popover", internal_targeting_flag=flag)++ def _own_by_survey_sampling(self, flag: FeatureFlag) -> None:+ Survey.objects.create(team=self.team, name="s", type="popover", internal_response_sampling_flag=flag)++ def _own_by_product_tour(self, flag: FeatureFlag) -> None:+ ProductTour.objects.create(team=self.team, name="t", internal_targeting_flag=flag)++ def _own_by_archived_product_tour(self, flag: FeatureFlag) -> None:+ ProductTour.objects.create(team=self.team, name="t", internal_targeting_flag=flag, archived=True)++ def _own_by_deleted_experiment(self, flag: FeatureFlag) -> None:+ Experiment.objects.create(team=self.team, name="exp", feature_flag=flag, deleted=True)++ def _own_by_early_access(self, flag: FeatureFlag) -> None:+ EarlyAccessFeature.objects.create(team=self.team, name="f", stage="beta", feature_flag=flag)++ def _reference_by_survey_linked_flag(self, flag: FeatureFlag) -> None:+ Survey.objects.create(team=self.team, name="s", type="popover", linked_flag=flag)++ @parameterized.expand(+ [+ ("experiment", "_own_by_experiment", "experiment"),+ ("survey targeting flag", "_own_by_survey_targeting", "survey"),+ ("survey internal flag", "_own_by_survey_internal", "survey"),+ ("survey sampling flag", "_own_by_survey_sampling", "survey"),+ ("product tour", "_own_by_product_tour", "product_tour"),+ ("archived product tour", "_own_by_archived_product_tour", "product_tour"),+ ("early access feature", "_own_by_early_access", "early_access_feature"),+ ("deleted experiment", "_own_by_deleted_experiment", "experiment"),+ ("survey linked flag", "_reference_by_survey_linked_flag", None),+ ("nothing", None, None),+ ]+ )+ def test_flag_owner_kind(self, name: str, setup: str | None, expected: str | None) -> None:+ flag = self._flag(f"owned-by-{name.replace(' ', '-')}")+ if setup:+ getattr(self, setup)(flag)++ assert flag_owner_kind(flag) == expected++ def test_guard_rejects_a_flag_a_different_product_owns(self) -> None:+ flag = self._flag("taken")+ self._own_by_experiment(flag)++ with self.assertRaises(serializers.ValidationError) as cm:+ assert_flag_available_for(flag, product=FLAG_OWNER_SURVEY)++ assert "already belongs to an experiment" in str(cm.exception)++ def test_guard_allows_a_free_flag(self) -> None:+ assert_flag_available_for(self._flag("free"), product=FLAG_OWNER_SURVEY)++ def test_guard_allows_the_same_product_to_share_a_flag(self) -> None:+ flag = self._flag("shared")+ self._own_by_experiment(flag)++ assert_flag_available_for(flag, product="experiment")+++class TestSurveyFlagAdoptionGuard(APIBaseTest):+ def test_survey_cannot_adopt_a_flag_another_product_owns(self) -> None:+ flag = FeatureFlag.objects.create(team=self.team, key="experiment-flag", created_by=self.user)+ Experiment.objects.create(team=self.team, name="exp", feature_flag=flag)++ response = self.client.post(+ f"/api/projects/{self.team.id}/surveys/",+ data={"name": "poacher", "type": "popover", "targeting_flag_id": flag.id},+ format="json",+ )++ assert response.status_code == 400, response.json()+ assert "already belongs to an experiment" in str(response.json())++ def test_survey_cannot_be_repointed_at_a_flag_another_product_owns(self) -> None:+ created = self.client.post(+ f"/api/projects/{self.team.id}/surveys/",+ data={"name": "plain", "type": "popover"},+ format="json",+ )+ assert created.status_code == 201, created.json()++ flag = FeatureFlag.objects.create(team=self.team, key="taken-by-experiment", created_by=self.user)+ Experiment.objects.create(team=self.team, name="exp", feature_flag=flag)++ response = self.client.patch(+ f"/api/projects/{self.team.id}/surveys/{created.json()['id']}/",+ data={"targeting_flag_id": flag.id},+ format="json",+ )++ assert response.status_code == 400, response.json()+ assert "already belongs to an experiment" in str(response.json())++ def test_survey_can_be_saved_again_with_the_flag_it_already_owns(self) -> None:+ created = self.client.post(+ f"/api/projects/{self.team.id}/surveys/",+ data={+ "name": "targeted",+ "type": "popover",+ "targeting_flag_filters": {"groups": [{"variant": None, "rollout_percentage": 50, "properties": []}]},+ },+ format="json",+ )+ assert created.status_code == 201, created.json()+ survey = Survey.objects.get(id=created.json()["id"])+ assert survey.targeting_flag_id is not None++ response = self.client.patch(+ f"/api/projects/{self.team.id}/surveys/{survey.id}/",+ data={"targeting_flag_id": survey.targeting_flag_id, "name": "renamed"},+ format="json",+ )++ assert response.status_code == 200, response.json()diff --git a/products/surveys/backend/api/survey.py b/products/surveys/backend/api/survey.pyindex e43573bbd863..ed698a2e9429 100644--- a/products/surveys/backend/api/survey.py+++ b/products/surveys/backend/api/survey.py@@ -75,6 +75,7 @@ from products.feature_flags.backend.api.feature_flag import (assert_feature_flag_write_scope,)from products.feature_flags.backend.models.feature_flag import FeatureFlag+from products.feature_flags.backend.ownership import FLAG_OWNER_SURVEY, assert_flag_available_forfrom products.product_analytics.backend.facade.models import Insightfrom products.surveys.backend.models import MAX_ITERATION_COUNT, Survey, SurveyResponseArchive, ensure_question_idsfrom products.surveys.backend.responses import (@@ -1525,9 +1526,12 @@ class SurveySerializerCreateUpdateOnly(serializers.ModelSerializer):targeting_flag_id = data.get("targeting_flag_id")if targeting_flag_id:try:- FeatureFlag.objects.get(pk=targeting_flag_id, team_id=self.context["team_id"])+ targeting_flag = FeatureFlag.objects.get(pk=targeting_flag_id, team_id=self.context["team_id"])except FeatureFlag.DoesNotExist:raise serializers.ValidationError("Targeting Feature Flag with this ID does not exist")+ # Re-saving a survey with the flag it already owns is not an adoption.+ if self.instance is None or self.instance.targeting_flag_id != targeting_flag_id:+ assert_flag_available_for(targeting_flag, product=FLAG_OWNER_SURVEY)linked_insight_id = data.get("linked_insight_id")if linked_insight_id:diff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex b8e04561b7d3..182b7440ffa3 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -30244,7 +30244,7 @@ export namespace Schemas {* @nullable*/readonly assignee: EarlyAccessFeatureSerializerCreateOnlyAssignee;- /** Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate. */+ /** Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not belong to another product such as a survey or experiment, must not be group-based, and must not be multivariate. */feature_flag_id?: number;readonly feature_flag: MinimalFeatureFlag;_create_in_folder?: string;diff --git a/services/mcp/src/generated/early_access_features/api.ts b/services/mcp/src/generated/early_access_features/api.tsindex 847644403fac..80de92a93a10 100644--- a/services/mcp/src/generated/early_access_features/api.ts+++ b/services/mcp/src/generated/early_access_features/api.ts@@ -62,7 +62,7 @@ export const EarlyAccessFeatureCreateBody = () => zod.number().optional().describe(- 'Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate.'+ 'Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not belong to another product such as a survey or experiment, must not be group-based, and must not be multivariate.'),_create_in_folder: zod.string().optional(),})diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/early-access-feature-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/early-access-feature-create.jsonindex 27f682c0460a..5df2cdcbc19b 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/early-access-feature-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/early-access-feature-create.json@@ -20,7 +20,7 @@"description": "URL to external documentation for this feature. Shown to users in the opt-in UI."},"feature_flag_id": {- "description": "Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not be group-based, and must not be multivariate.",+ "description": "Optional ID of an existing feature flag to link. If omitted, a new flag is auto-created from the feature name. The flag must not already be linked to another feature, must not belong to another product such as a survey or experiment, must not be group-based, and must not be multivariate.","type": "number"},"name": {