feat(experiments): 重设计多组比例与返回值配置
- 方案使用动态分组表,支持添加删除、互补比例、平均分配与合计校验 - 移除默认方案,用户管理与结束实验按实际分组展示 - 固定弹窗标题和操作区并同步多组说明
This commit is contained in:
+8
-10
@@ -1154,7 +1154,9 @@ export type Entry = {
|
||||
caseSensitive: boolean;
|
||||
scanDepth: number;
|
||||
};
|
||||
/** 测试方案:A/B 的返回值遵循已注册类型的数据契约。 */
|
||||
/** 组比例以万分比保存,key使用A至Z,0%组仍可用于人工指定。 */
|
||||
export type ExperimentGroup = { key: string; weight: number; value: unknown };
|
||||
/** 测试方案:动态分组的返回值遵循已注册类型的数据契约。 */
|
||||
export type Experiment = {
|
||||
id: string;
|
||||
name: string;
|
||||
@@ -1168,13 +1170,9 @@ export type Experiment = {
|
||||
cutoff?: string;
|
||||
accounts: string[];
|
||||
traffic: number;
|
||||
weightB: number;
|
||||
baseline: "A" | "B";
|
||||
winner?: "A" | "B";
|
||||
presetA?: string;
|
||||
presetB?: string;
|
||||
groups: ExperimentGroup[];
|
||||
winner?: string;
|
||||
description: string;
|
||||
values?: { A: unknown; B: unknown };
|
||||
typeRevision?: number;
|
||||
};
|
||||
};
|
||||
@@ -1213,16 +1211,16 @@ export type ExperimentUser = {
|
||||
status: string;
|
||||
createdAt: string;
|
||||
decision: null | {
|
||||
variant: "A" | "B";
|
||||
variant: string | null;
|
||||
reason: string;
|
||||
value: unknown;
|
||||
revision: number;
|
||||
};
|
||||
override: null | {
|
||||
variant: "A" | "B";
|
||||
variant: string;
|
||||
reason: string;
|
||||
expiresAt: string;
|
||||
bypassAudience: number;
|
||||
};
|
||||
assignment: null | { variant: "A" | "B"; createdAt: string };
|
||||
assignment: null | { variant: string; createdAt: string };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user