managing-experiment-lifecycle

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Managing 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──▶ draft
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──▶ draft

Actions and their implications

操作及其影响

For each action, the two key questions:
  1. Who sees what variant? (user perspective)
  2. Who is in my analysis? (statistical perspective)
对于每个操作,需关注两个核心问题:
  1. 用户会看到哪个Variant?(用户视角)
  2. 哪些用户会被纳入分析?(统计视角)

Launch (
experiment-launch
)

启动 (
experiment-launch
)

Transitions 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
)

Deactivates 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
    /decide
    — no new exposure events recorded
  • Analysis: no new data while paused, but existing data is preserved. Experiment stays "running".
No request body. Use
experiment-resume
to reactivate.
停用feature flag。用户回退到默认体验(通常为control)。
  • 前提条件:必须处于running状态且未被暂停
  • Variant分配
    /decide
    接口不再返回该flag——不会记录新的曝光事件
  • 分析:暂停期间不会收集新数据,但现有数据会被保留。实验仍处于"running"状态。
无需请求体。使用
experiment-resume
重新激活。

Resume (
experiment-resume
)

恢复 (
experiment-resume
)

Reactivates 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
)

Sets
end_date
and transitions to stopped. The feature flag is NOT modified.
  • 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:
conclusion
("won", "lost", "inconclusive", "stopped_early", "invalid") and
conclusion_comment
.
Use this when you want to freeze results without changing what users see.
设置
end_date
并转换为stopped状态。feature flag 不会被修改
  • 前提条件:必须处于running状态(已启动,未结束)
  • Variant分配:用户仍会看到已分配的Variant(flag保持激活)
  • 分析:结果冻结为
    end_date
    之前的数据
可选请求体:
conclusion
(取值为"won"、"lost"、"inconclusive"、"stopped_early"、"invalid")和
conclusion_comment
当你希望冻结实验结果但不改变用户所见内容时使用此操作。

Ship variant (
experiment-ship-variant
)

发布Variant (
experiment-ship-variant
)

Rewrites 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:
variant_key
(e.g. "test"). Optional:
conclusion
,
conclusion_comment
.
Returns 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。
必填参数:
variant_key
(例如"test")。可选参数:
conclusion
conclusion_comment
如果flag变更需要审批策略审核,会返回409错误。

Archive (
experiment-archive
)

归档 (
experiment-archive
)

Hides 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
archived=false
via
experiment-update
.
将已结束的实验从默认列表视图中隐藏。
  • 前提条件:必须处于stopped状态(已设置
    end_date
  • Variant分配:无变化——flag不受影响
  • 分析:无变化——结果仍可访问
无需请求体。可通过
experiment-update
设置
archived=false
恢复。

Reset (
experiment-reset
)

重置 (
experiment-reset
)

Returns an experiment to draft state. Clears
start_date
,
end_date
,
conclusion
, and
archived
.
  • 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
    start_date
    is adjusted after re-launch
No request body.
将实验恢复为draft状态。清除
start_date
end_date
conclusion
archived
字段。
  • 前提条件:当前不能处于draft状态
  • Variant分配:flag保持不变——用户仍会看到已分配的Variant
  • 分析:之前收集的数据仍然存在,但除非重新启动后调整
    start_date
    ,否则不会被纳入结果
无需请求体。

Duplicate (
experiment-duplicate
)

复制 (
experiment-duplicate
)

Creates a copy as a new draft with fresh dates and no results.
Important: always provide a unique
feature_flag_key
different from the original. If the same key is used, both experiments share a flag — changes to one affect both.
Optional: custom
name
(defaults to "Original Name (Copy)").
创建一个新的draft副本,包含新的日期且无实验结果。
重要提示:务必提供与原实验不同的唯一
feature_flag_key
。如果使用相同的key,两个实验会共享同一个flag——对其中一个的修改会影响另一个。
可选参数:自定义
name
(默认值为"Original Name (Copy)")。

Decision framework

决策框架

SituationActionTool
Draft ready, flag implemented, metrics setLaunch
experiment-launch
Clear winner, significant resultsShip the winning variant
experiment-ship-variant
No significant difference after sufficient timeEnd as inconclusive
experiment-end
Something wrong, need to stop exposure temporarilyPause
experiment-pause
Resume after pauseResume
experiment-resume
Experiment ended, ready to clean upArchive
experiment-archive
Need to start over with same configReset to draft
experiment-reset
Want a similar experiment with a fresh startDuplicate
experiment-duplicate
场景操作工具
草稿已就绪,flag已实现,指标已设置启动
experiment-launch
已明确获胜Variant,结果显著发布获胜Variant
experiment-ship-variant
经过足够时间后仍无显著差异标记为无结论并结束
experiment-end
出现问题,需要暂时停止用户曝光暂停
experiment-pause
暂停后恢复实验恢复
experiment-resume
实验已结束,准备清理归档
experiment-archive
需要使用相同配置重新开始重置为草稿
experiment-reset
想要创建类似实验并重新开始复制
experiment-duplicate

Resolving experiments

实验解析

All lifecycle actions require an experiment ID. If you don't have one, load the
finding-experiments
skill to resolve the user's reference (name, description, "latest", etc.) to a concrete ID before proceeding.
所有生命周期操作都需要实验ID。如果没有实验ID,请加载
finding-experiments
技能,将用户的引用(名称、描述、"latest"等)解析为具体ID后再继续操作。

Error handling

错误处理

Error messageMeaning
"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错误时,请向用户解释情况,不要重试。