managing-experiment-lifecycle
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseManaging experiment lifecycle
管理实验生命周期
This skill covers experiment state transitions — what each action does, when to use it, and how it affects variant assignment and analysis.
本技能涵盖实验状态转换——每个操作的作用、适用场景,以及对Variant分配和分析的影响。
State diagram
状态图
text
draft ──launch──▶ running ──end──▶ stopped ──archive──▶ archived
│ ▲ │
pause resume ship_variant
│ │ (also ends if running)
▼ │
paused (flag inactive, still "running" status)
Any non-draft state ──reset──▶ drafttext
draft ──launch──▶ running ──end──▶ stopped ──archive──▶ archived
│ ▲ │
pause resume ship_variant
│ │ (also ends if running)
▼ │
paused (flag inactive, still "running" status)
Any non-draft state ──reset──▶ draftActions and their implications
操作及其影响
For each action, the two key questions:
- Who sees what variant? (user perspective)
- Who is in my analysis? (statistical perspective)
对于每个操作,需关注两个核心问题:
- 用户会看到哪个Variant?(用户视角)
- 哪些用户会被纳入分析?(统计视角)
Launch (experiment-launch
)
experiment-launch启动 (experiment-launch
)
experiment-launchTransitions draft → running. Activates the feature flag and sets .
start_date- Preconditions: must be in draft, flag needs ≥2 variants with "control" first
- Pre-launch checklist: has at least one metric? Variants correct? Flag implemented in code?
- Variants: users start being bucketed into variants based on the configured split
- Analysis: data collection begins from
start_date
No request body needed.
从draft状态转换为running状态。激活feature flag并设置。
start_date- 前提条件:必须处于draft状态,feature flag需包含至少2个Variant,且第一个为"control"
- 启动前检查清单:是否至少设置了一个指标?Variant是否正确?feature flag是否已在代码中实现?
- Variant分配:用户开始根据配置的分流比例被分配到不同Variant
- 分析:从开始收集数据
start_date
无需请求体。
Pause (experiment-pause
)
experiment-pause暂停 (experiment-pause
)
experiment-pauseDeactivates the feature flag. Users fall back to the default experience (typically control).
- Preconditions: must be running and not already paused
- Variants: flag is not returned by — no new exposure events recorded
/decide - Analysis: no new data while paused, but existing data is preserved. Experiment stays "running".
No request body. Use to reactivate.
experiment-resume停用feature flag。用户回退到默认体验(通常为control)。
- 前提条件:必须处于running状态且未被暂停
- Variant分配:接口不再返回该flag——不会记录新的曝光事件
/decide - 分析:暂停期间不会收集新数据,但现有数据会被保留。实验仍处于"running"状态。
无需请求体。使用重新激活。
experiment-resumeResume (experiment-resume
)
experiment-resume恢复 (experiment-resume
)
experiment-resumeReactivates the feature flag after a pause. Users are re-bucketed deterministically into the same variants.
- Preconditions: must be paused
- Variants: same assignment as before pause — deterministic bucketing
- Analysis: exposure tracking resumes
No request body.
暂停后重新激活feature flag。用户会被确定性地分配到暂停前的同一Variant。
- 前提条件:必须处于暂停状态
- Variant分配:与暂停前的分配一致——确定性分流
- 分析:恢复曝光追踪
无需请求体。
End (experiment-end
)
experiment-end结束 (experiment-end
)
experiment-endSets and transitions to stopped. The feature flag is NOT modified.
end_date- Preconditions: must be running (launched, not already stopped)
- Variants: users continue seeing assigned variants (flag stays active)
- Analysis: results frozen to data up to
end_date
Optional body: ("won", "lost", "inconclusive", "stopped_early", "invalid") and .
conclusionconclusion_commentUse this when you want to freeze results without changing what users see.
设置并转换为stopped状态。feature flag 不会被修改。
end_date- 前提条件:必须处于running状态(已启动,未结束)
- Variant分配:用户仍会看到已分配的Variant(flag保持激活)
- 分析:结果冻结为之前的数据
end_date
可选请求体:(取值为"won"、"lost"、"inconclusive"、"stopped_early"、"invalid")和。
conclusionconclusion_comment当你希望冻结实验结果但不改变用户所见内容时使用此操作。
Ship variant (experiment-ship-variant
)
experiment-ship-variant发布Variant (experiment-ship-variant
)
experiment-ship-variantRewrites the feature flag so the selected variant is served to 100% of users.
- Preconditions: must be launched (running or stopped). Cannot ship from draft.
- Variants: ALL users see the shipped variant. The flag is rewritten with a catch-all group.
- Analysis: if still running, the experiment is also ended (end_date set)
Always confirm with the user before shipping — this permanently rewrites the feature flag.
Required: (e.g. "test"). Optional: , .
variant_keyconclusionconclusion_commentReturns 409 if an approval policy requires review before the flag change.
重写feature flag,使选定的Variant面向100%的用户提供服务。
- 前提条件:必须已启动(处于running或stopped状态)。无法从draft状态发布。
- Variant分配:所有用户都会看到已发布的Variant。flag会被重写为包含一个全量覆盖组。
- 分析:如果实验仍处于running状态,会同时结束实验(设置)
end_date
发布前务必与用户确认——此操作会永久重写feature flag。
必填参数:(例如"test")。可选参数:、。
variant_keyconclusionconclusion_comment如果flag变更需要审批策略审核,会返回409错误。
Archive (experiment-archive
)
experiment-archive归档 (experiment-archive
)
experiment-archiveHides a stopped experiment from the default list view.
- Preconditions: must be stopped (end_date set)
- Variants: no change — flag is unaffected
- Analysis: no change — results remain accessible
No request body. Can be restored by setting via .
archived=falseexperiment-update将已结束的实验从默认列表视图中隐藏。
- 前提条件:必须处于stopped状态(已设置)
end_date - Variant分配:无变化——flag不受影响
- 分析:无变化——结果仍可访问
无需请求体。可通过设置恢复。
experiment-updatearchived=falseReset (experiment-reset
)
experiment-reset重置 (experiment-reset
)
experiment-resetReturns an experiment to draft state. Clears , , , and .
start_dateend_dateconclusionarchived- Preconditions: must not already be in draft
- Variants: flag is left unchanged — users continue seeing assigned variants
- Analysis: previously collected data still exists but won't be included in results unless is adjusted after re-launch
start_date
No request body.
将实验恢复为draft状态。清除、、和字段。
start_dateend_dateconclusionarchived- 前提条件:当前不能处于draft状态
- Variant分配:flag保持不变——用户仍会看到已分配的Variant
- 分析:之前收集的数据仍然存在,但除非重新启动后调整,否则不会被纳入结果
start_date
无需请求体。
Duplicate (experiment-duplicate
)
experiment-duplicate复制 (experiment-duplicate
)
experiment-duplicateCreates a copy as a new draft with fresh dates and no results.
Important: always provide a unique different from the original. If the same key is used, both experiments share a flag — changes to one affect both.
feature_flag_keyOptional: custom (defaults to "Original Name (Copy)").
name创建一个新的draft副本,包含新的日期且无实验结果。
重要提示:务必提供与原实验不同的唯一。如果使用相同的key,两个实验会共享同一个flag——对其中一个的修改会影响另一个。
feature_flag_key可选参数:自定义(默认值为"Original Name (Copy)")。
nameDecision framework
决策框架
| Situation | Action | Tool |
|---|---|---|
| Draft ready, flag implemented, metrics set | Launch | |
| Clear winner, significant results | Ship the winning variant | |
| No significant difference after sufficient time | End as inconclusive | |
| Something wrong, need to stop exposure temporarily | Pause | |
| Resume after pause | Resume | |
| Experiment ended, ready to clean up | Archive | |
| Need to start over with same config | Reset to draft | |
| Want a similar experiment with a fresh start | Duplicate | |
| 场景 | 操作 | 工具 |
|---|---|---|
| 草稿已就绪,flag已实现,指标已设置 | 启动 | |
| 已明确获胜Variant,结果显著 | 发布获胜Variant | |
| 经过足够时间后仍无显著差异 | 标记为无结论并结束 | |
| 出现问题,需要暂时停止用户曝光 | 暂停 | |
| 暂停后恢复实验 | 恢复 | |
| 实验已结束,准备清理 | 归档 | |
| 需要使用相同配置重新开始 | 重置为草稿 | |
| 想要创建类似实验并重新开始 | 复制 | |
Resolving experiments
实验解析
All lifecycle actions require an experiment ID. If you don't have one, load the
skill to resolve the user's reference (name, description,
"latest", etc.) to a concrete ID before proceeding.
finding-experiments所有生命周期操作都需要实验ID。如果没有实验ID,请加载技能,将用户的引用(名称、描述、"latest"等)解析为具体ID后再继续操作。
finding-experimentsError handling
错误处理
| Error message | Meaning |
|---|---|
| "Experiment has already been launched." | Can't launch a non-draft experiment |
| "Experiment has not been launched yet." | Can't end/pause/ship a draft |
| "Experiment has already ended." | Can't end/pause a stopped experiment |
| "Experiment is already paused." | Use resume instead |
| "Experiment is not paused." | It's already active |
| "Experiment is already in draft state." | Nothing to reset |
| "Experiment is already archived." | Already done |
When you get a 400, explain the situation to the user rather than retrying.
| 错误信息 | 含义 |
|---|---|
| "Experiment has already been launched." | 无法启动非draft状态的实验 |
| "Experiment has not been launched yet." | 无法结束/暂停/发布draft状态的实验 |
| "Experiment has already ended." | 无法结束/暂停已停止的实验 |
| "Experiment is already paused." | 请使用恢复操作替代 |
| "Experiment is not paused." | 实验已处于激活状态 |
| "Experiment is already in draft state." | 无需重置 |
| "Experiment is already archived." | 已完成归档操作 |
收到400错误时,请向用户解释情况,不要重试。