: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(experiments): add per-variant notes field (#65408)
Juraj Majerikbb6b18fe31a4
diff --git a/frontend/src/queries/schema.json b/frontend/src/queries/schema.jsonindex d19cd56038b4..050e496c0434 100644--- a/frontend/src/queries/schema.json+++ b/frontend/src/queries/schema.json@@ -19864,6 +19864,13 @@"rollout_percentage": {"description": "Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100.","type": "number"+ },+ "variant_notes": {+ "additionalProperties": {+ "type": "string"+ },+ "description": "Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL.",+ "type": "object"}},"type": "object"diff --git a/frontend/src/queries/schema/schema-general.ts b/frontend/src/queries/schema/schema-general.tsindex c71d1ac2808f..a65ec9c8e140 100644--- a/frontend/src/queries/schema/schema-general.ts+++ b/frontend/src/queries/schema/schema-general.ts@@ -3959,6 +3959,8 @@ export interface ExperimentParameters {rollout_percentage?: number/** Variant keys to exclude from metric result calculations. Excluded variants are still served to users but omitted from statistical analysis. */excluded_variants?: string[]+ /** Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL. */+ variant_notes?: Record<string, string>}/** Exposure estimate settings for the experiment running-time calculator. */diff --git a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsxindex 3968b808a427..fd1c7dc817b7 100644--- a/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx+++ b/frontend/src/scenes/experiments/ExperimentView/DistributionTable.tsx@@ -27,6 +27,7 @@ import { modalsLogic } from '~/scenes/experiments/modalsLogic'import { MultivariateFlagVariant } from '~/types'import { HoldoutSelector } from './HoldoutSelector'+import { VariantNotes } from './VariantNotes'import { VariantScreenshot } from './VariantScreenshot'import { VariantTag } from './VariantTag'@@ -147,7 +148,10 @@ export function DistributionTable(): JSX.Element {},})}- const className = experiment?.type === 'web' ? 'w-1/2.5' : 'w-1/3'+ // Keep every column the same width: base columns (Variant, Split, Screenshot, Notes)+ // plus the optional Analysis and web Preview columns.+ const columnCount = 4 + (excludedVariantsEnabled ? 1 : 0) + (experiment?.type === 'web' ? 1 : 0)+ const className = { 4: 'w-1/4', 5: 'w-1/5', 6: 'w-1/6' }[columnCount] ?? 'w-1/4'const columns: LemonTableColumns<MultivariateFlagVariant> = [{className: className,@@ -229,6 +233,17 @@ export function DistributionTable(): JSX.Element {)},},+ {+ className: className,+ key: 'variant_notes',+ title: 'Notes',+ render: function Key(_, item): JSX.Element {+ if (item.key === `holdout-${experiment.holdout?.id}`) {+ return <div className="h-16" />+ }+ return <VariantNotes variantKey={item.key} />+ },+ },]if (experiment.type === 'web') {diff --git a/frontend/src/scenes/experiments/ExperimentView/VariantNotes.tsx b/frontend/src/scenes/experiments/ExperimentView/VariantNotes.tsxnew file mode 100644index 000000000000..a3ffc9421292--- /dev/null+++ b/frontend/src/scenes/experiments/ExperimentView/VariantNotes.tsx@@ -0,0 +1,67 @@+import { useActions, useValues } from 'kea'+import { useState } from 'react'++import { IconCheck, IconPencil } from '@posthog/icons'++import { experimentLogic } from '../experimentLogic'++// Shared box model so the display div and the edit textarea have identical+// dimensions — switching between them causes no layout shift.+const BOX = 'h-20 w-full p-2 rounded border text-sm overflow-auto'++export function VariantNotes({ variantKey }: { variantKey: string }): JSX.Element {+ const { experiment } = useValues(experimentLogic)+ const { updateExperimentVariantNotes } = useActions(experimentLogic)++ const note = experiment.parameters?.variant_notes?.[variantKey] ?? ''+ const [isEditing, setIsEditing] = useState(false)+ const [draft, setDraft] = useState(note)++ const handleSave = (): void => {+ if (draft !== note) {+ updateExperimentVariantNotes({+ ...experiment.parameters?.variant_notes,+ [variantKey]: draft,+ })+ }+ setIsEditing(false)+ }++ if (isEditing) {+ return (+ <div className="relative my-2">+ <textarea+ className={`${BOX} block border-solid border-primary resize-none focus:outline-none`}+ value={draft}+ onChange={(e) => setDraft(e.target.value)}+ onBlur={handleSave}+ onFocus={(e) => e.target.setSelectionRange(e.target.value.length, e.target.value.length)}+ autoFocus+ />+ <button+ type="button"+ aria-label="Save notes"+ className="absolute bottom-1 right-1 flex p-1 rounded text-base text-secondary hover:text-primary hover:bg-fill-button-tertiary-hover cursor-pointer"+ // Keep focus on the textarea so onBlur doesn't fire and unmount us before onClick.+ onMouseDown={(e) => e.preventDefault()}+ onClick={handleSave}+ >+ <IconCheck />+ </button>+ </div>+ )+ }++ return (+ <div+ className={`${BOX} relative my-2 border-dashed border-border hover:border-primary cursor-text whitespace-pre-wrap break-words`}+ onClick={() => {+ setDraft(note)+ setIsEditing(true)+ }}+ >+ <span className="pr-5">{note}</span>+ <IconPencil className="absolute top-1 right-1 text-muted opacity-50" />+ </div>+ )+}diff --git a/frontend/src/scenes/experiments/experimentLogic.tsx b/frontend/src/scenes/experiments/experimentLogic.tsxindex 7e5ef0040efb..b13b97c8a6f1 100644--- a/frontend/src/scenes/experiments/experimentLogic.tsx+++ b/frontend/src/scenes/experiments/experimentLogic.tsx@@ -720,6 +720,7 @@ export const experimentLogic = kea<experimentLogicType>([updateExperimentVariantImages: (variantPreviewMediaIds: Record<string, string[]>) => ({variantPreviewMediaIds,}),+ updateExperimentVariantNotes: (variantNotes: Record<string, string>) => ({ variantNotes }),setExposureCriteria: (exposureCriteria: ExperimentExposureCriteria) => ({ exposureCriteria }),createExperimentDashboard: true,setIsCreatingExperimentDashboard: (isCreating: boolean) => ({ isCreating }),@@ -1869,6 +1870,23 @@ export const experimentLogic = kea<experimentLogicType>([lemonToast.error('Failed to update experiment variant images')}},+ updateExperimentVariantNotes: async ({ variantNotes }) => {+ try {+ const updatedParameters = {+ ...values.experiment.parameters,+ variant_notes: variantNotes,+ }+ await api.update(`api/projects/${values.currentProjectId}/experiments/${values.experimentId}`, {+ parameters: updatedParameters,+ update_feature_flag_params: false,+ })+ actions.setExperiment({+ parameters: updatedParameters,+ })+ } catch {+ lemonToast.error('Failed to update experiment variant notes')+ }+ },updateDistribution: async ({ variants, rolloutPercentage }) => {const { rollout_percentage: _, ...otherParams } = values.experiment?.parameters || {}actions.updateExperiment({diff --git a/frontend/src/types.ts b/frontend/src/types.tsindex 48459bcc1ad1..821de5504954 100644--- a/frontend/src/types.ts+++ b/frontend/src/types.ts@@ -4746,6 +4746,7 @@ export interface Experiment {custom_exposure_filter?: FilterTypeaggregation_group_type_index?: integervariant_screenshot_media_ids?: Record<string, string[]>+ variant_notes?: Record<string, string>rollout_percentage?: numberexcluded_variants?: string[]/** Present when the experiment was created from an LLM prompt via /create_from_prompt/. */diff --git a/posthog/schema.py b/posthog/schema.pyindex dc60bc8d7589..5bb0ea2f0b66 100644--- a/posthog/schema.py+++ b/posthog/schema.py@@ -5040,6 +5040,13 @@ class ExperimentParameters(BaseModel):" are excluded from analysis. Default: 100."),)+ variant_notes: dict[str, str] | None = Field(+ default=None,+ description=(+ "Free-text notes per variant, keyed by variant key. Use to document what"+ " each variant does or its reroute URL."+ ),+ )class ExperimentStatsBase(BaseModel):diff --git a/products/experiments/backend/presentation/serializers.py b/products/experiments/backend/presentation/serializers.pyindex 890cb6fcd888..f9f05c0911ce 100644--- a/products/experiments/backend/presentation/serializers.py+++ b/products/experiments/backend/presentation/serializers.py@@ -153,9 +153,10 @@ class ExperimentBaseSerializer(UserAccessControlSerializerMixin, serializers.Mod"Experiment parameters JSON. Supported keys include ""`feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, ""`recommended_running_time`, `recommended_sample_size`, "- "`custom_exposure_filter`, and `excluded_variants` "+ "`custom_exposure_filter`, `excluded_variants` ""(list of variant keys to drop from statistical analysis; "- "the baseline variant and holdout pseudo-variants cannot be excluded). "+ "the baseline variant and holdout pseudo-variants cannot be excluded), "+ "and `variant_notes` (free-text notes per variant, keyed by variant key). ""The running-time calculator keys (`minimum_detectable_effect`, ""`recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) ""are deprecated here — prefer `running_time_calculation`."diff --git a/products/experiments/frontend/generated/api.schemas.ts b/products/experiments/frontend/generated/api.schemas.tsindex 24d32997f184..fe6f11c03a29 100644--- a/products/experiments/frontend/generated/api.schemas.ts+++ b/products/experiments/frontend/generated/api.schemas.ts@@ -235,6 +235,11 @@ export interface ExperimentVariantApi {split_percent?: number | null}+/**+ * Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL.+ */+export type ExperimentParametersApiVariantNotes = { [key: string]: string } | null+export interface ExperimentParametersApi {/** Variant keys to exclude from metric result calculations. Excluded variants are still served to users but omitted from statistical analysis. */excluded_variants?: string[] | null@@ -244,6 +249,8 @@ export interface ExperimentParametersApi {minimum_detectable_effect?: number | null/** Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100. */rollout_percentage?: number | null+ /** Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL. */+ variant_notes?: ExperimentParametersApiVariantNotes}export type ConversionRateInputTypeApi = (typeof ConversionRateInputTypeApi)[keyof typeof ConversionRateInputTypeApi]@@ -359,7 +366,7 @@ export interface ExperimentBasicApi {readonly holdout: ExperimentHoldoutApi/** @nullable */readonly exposure_cohort: number | null- /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */+ /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */parameters?: ExperimentParametersApi | null/** Running-time calculator state: `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, and `exposure_estimate_config`. Canonical home for these keys, which historically lived in `parameters`; values are kept in sync with `parameters` during the deprecation window. */running_time_calculation?: ExperimentRunningTimeCalculationApi | null@@ -664,7 +671,7 @@ export interface ExperimentApi {holdout_id?: number | null/** @nullable */readonly exposure_cohort: number | null- /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */+ /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */parameters?: ExperimentParametersApi | null/** Running-time calculator state: `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, and `exposure_estimate_config`. Canonical home for these keys, which historically lived in `parameters`; values are kept in sync with `parameters` during the deprecation window. */running_time_calculation?: ExperimentRunningTimeCalculationApi | null@@ -765,7 +772,7 @@ export interface PatchedExperimentApi {holdout_id?: number | null/** @nullable */readonly exposure_cohort?: number | null- /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */+ /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */parameters?: ExperimentParametersApi | null/** Running-time calculator state: `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, and `exposure_estimate_config`. Canonical home for these keys, which historically lived in `parameters`; values are kept in sync with `parameters` during the deprecation window. */running_time_calculation?: ExperimentRunningTimeCalculationApi | nulldiff --git a/services/mcp/src/api/generated.ts b/services/mcp/src/api/generated.tsindex 9cfaba3a4ba8..7c6862b10f19 100644--- a/services/mcp/src/api/generated.ts+++ b/services/mcp/src/api/generated.ts@@ -20346,6 +20346,11 @@ export namespace Schemas {split_percent?: number | null;}+ /**+ * Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL.+ */+ export type ExperimentParametersVariantNotes = {[key: string]: string} | null;+export interface ExperimentParameters {/** Variant keys to exclude from metric result calculations. Excluded variants are still served to users but omitted from statistical analysis. */excluded_variants?: string[] | null;@@ -20355,6 +20360,8 @@ export namespace Schemas {minimum_detectable_effect?: number | null;/** Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100. */rollout_percentage?: number | null;+ /** Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL. */+ variant_notes?: ExperimentParametersVariantNotes;}export type ManualMetricType = typeof ManualMetricType[keyof typeof ManualMetricType];@@ -20562,7 +20569,7 @@ export namespace Schemas {holdout_id?: number | null;/** @nullable */readonly exposure_cohort: number | null;- /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */+ /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */parameters?: ExperimentParameters | null;/** Running-time calculator state: `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, and `exposure_estimate_config`. Canonical home for these keys, which historically lived in `parameters`; values are kept in sync with `parameters` during the deprecation window. */running_time_calculation?: ExperimentRunningTimeCalculation | null;@@ -20666,7 +20673,7 @@ export namespace Schemas {readonly holdout: ExperimentHoldout;/** @nullable */readonly exposure_cohort: number | null;- /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */+ /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */parameters?: ExperimentParameters | null;/** Running-time calculator state: `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, and `exposure_estimate_config`. Canonical home for these keys, which historically lived in `parameters`; values are kept in sync with `parameters` during the deprecation window. */running_time_calculation?: ExperimentRunningTimeCalculation | null;@@ -35501,7 +35508,7 @@ export namespace Schemas {holdout_id?: number | null;/** @nullable */readonly exposure_cohort?: number | null;- /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */+ /** Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`. */parameters?: ExperimentParameters | null;/** Running-time calculator state: `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, and `exposure_estimate_config`. Canonical home for these keys, which historically lived in `parameters`; values are kept in sync with `parameters` during the deprecation window. */running_time_calculation?: ExperimentRunningTimeCalculation | null;diff --git a/services/mcp/src/generated/experiments/api.ts b/services/mcp/src/generated/experiments/api.tsindex 7f9f407cf051..1c27c9f3b1e4 100644--- a/services/mcp/src/generated/experiments/api.ts+++ b/services/mcp/src/generated/experiments/api.ts@@ -306,12 +306,18 @@ export const ExperimentsCreateBody = /* @__PURE__ */ zod.describe('Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100.'),+ variant_notes: zod+ .union([zod.record(zod.string(), zod.string()), zod.null()])+ .optional()+ .describe(+ 'Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL.'+ ),}),zod.null(),]).optional().describe(- 'Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`.'+ 'Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`.'),running_time_calculation: zod.union([@@ -2682,12 +2688,18 @@ export const ExperimentsPartialUpdateBody = /* @__PURE__ */ zod.describe('Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100.'),+ variant_notes: zod+ .union([zod.record(zod.string(), zod.string()), zod.null()])+ .optional()+ .describe(+ 'Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL.'+ ),}),zod.null(),]).optional().describe(- 'Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`.'+ 'Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`.'),running_time_calculation: zod.union([@@ -5117,12 +5129,18 @@ export const ExperimentsDuplicateCreateBody = /* @__PURE__ */ zod.describe('Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100.'),+ variant_notes: zod+ .union([zod.record(zod.string(), zod.string()), zod.null()])+ .optional()+ .describe(+ 'Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL.'+ ),}),zod.null(),]).optional().describe(- 'Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`.'+ 'Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`.'),running_time_calculation: zod.union([diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.jsonindex 1ba9ac9dce83..e8d9b2995181 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-create.json@@ -308,6 +308,23 @@}],"description": "Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100."+ },+ "variant_notes": {+ "anyOf": [+ {+ "additionalProperties": {+ "type": "string"+ },+ "propertyNames": {+ "type": "string"+ },+ "type": "object"+ },+ {+ "type": "null"+ }+ ],+ "description": "Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL."}},"type": "object"diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.jsonindex eb93b81216ed..c10e9d3d38c8 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-duplicate.json@@ -3666,6 +3666,23 @@}],"description": "Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100."+ },+ "variant_notes": {+ "anyOf": [+ {+ "additionalProperties": {+ "type": "string"+ },+ "propertyNames": {+ "type": "string"+ },+ "type": "object"+ },+ {+ "type": "null"+ }+ ],+ "description": "Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL."}},"type": "object"@@ -3674,7 +3691,7 @@"type": "null"}],- "description": "Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`."+ "description": "Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`."},"primary_metrics_ordered_uuids": {},"running_time_calculation": {diff --git a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.jsonindex 3226da00fa50..b3cd1190c071 100644--- a/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json+++ b/services/mcp/tests/unit/__snapshots__/tool-schemas/experiment-update.json@@ -3634,6 +3634,23 @@}],"description": "Overall rollout percentage (0-100). Controls what fraction of all users enter the experiment. Users outside the rollout never see any variant and are excluded from analysis. Default: 100."+ },+ "variant_notes": {+ "anyOf": [+ {+ "additionalProperties": {+ "type": "string"+ },+ "propertyNames": {+ "type": "string"+ },+ "type": "object"+ },+ {+ "type": "null"+ }+ ],+ "description": "Free-text notes per variant, keyed by variant key. Use to document what each variant does or its reroute URL."}},"type": "object"@@ -3642,7 +3659,7 @@"type": "null"}],- "description": "Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, and `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`."+ "description": "Experiment parameters JSON. Supported keys include `feature_flag_variants`, `rollout_percentage`, `minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `custom_exposure_filter`, `excluded_variants` (list of variant keys to drop from statistical analysis; the baseline variant and holdout pseudo-variants cannot be excluded), and `variant_notes` (free-text notes per variant, keyed by variant key). The running-time calculator keys (`minimum_detectable_effect`, `recommended_running_time`, `recommended_sample_size`, `exposure_estimate_config`) are deprecated here — prefer `running_time_calculation`."},"running_time_calculation": {"anyOf": [