@thinkingai/ae-cli 6.1.10 → 6.1.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (232) hide show
  1. package/README.md +25 -3
  2. package/README.zh.md +25 -3
  3. package/dist/{auth-56Z45UVR.js → auth-GDV3H5I4.js} +18 -8
  4. package/dist/{auth-ENM3FE6L.js → auth-NN55553T.js} +3 -3
  5. package/dist/{capability-2H6PAOA3.js → capability-DRLGDVS4.js} +24 -17
  6. package/dist/{capability-YPOQX6PL.js → capability-P6GK3AQH.js} +24 -17
  7. package/dist/chunk-4NN5IWVN.js +26 -0
  8. package/dist/{chunk-DB4Q3ANU.js → chunk-6A2FUCIS.js} +3 -3
  9. package/dist/{chunk-PVBYJWC2.js → chunk-7KQWSBSL.js} +4 -4
  10. package/dist/{chunk-24BAVOX3.js → chunk-AXDXJTPC.js} +3 -1
  11. package/dist/{chunk-CPVTECJ3.js → chunk-DT6Y3TD7.js} +5 -5
  12. package/dist/{chunk-EGEIXA2Z.js → chunk-DWO43OIB.js} +0 -248
  13. package/dist/{chunk-V6FR6WTW.js → chunk-GJJA4CQZ.js} +34 -2
  14. package/dist/{chunk-RGXCNC4N.js → chunk-GS2P7LFD.js} +50 -17
  15. package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
  16. package/dist/{chunk-3P3562ZX.js → chunk-MVDZ7DBQ.js} +5 -5
  17. package/dist/{chunk-LCXU3AAT.js → chunk-NBPKWKRA.js} +2 -2
  18. package/dist/{chunk-HQ2A7ITL.js → chunk-RBNKI5ZW.js} +50 -17
  19. package/dist/{chunk-LHVM35J4.js → chunk-TS6BUGUY.js} +4 -4
  20. package/dist/chunk-TUKQZTMI.js +250 -0
  21. package/dist/{chunk-J7MZHDHQ.js → chunk-VKD5WQKN.js} +5 -5
  22. package/dist/{chunk-3KI3RRXX.js → chunk-VTXHDCBW.js} +3 -3
  23. package/dist/{chunk-KTYR3U6D.js → chunk-YTG6Q75E.js} +10 -6
  24. package/dist/{chunk-IR4ZLVPW.js → chunk-YV52FB5G.js} +25 -3
  25. package/dist/{chunk-E7UXXHO3.js → chunk-Z3OXWCIA.js} +3 -3
  26. package/dist/{cli-token-4SBMXAUK.js → cli-token-GL5MS5FK.js} +4 -4
  27. package/dist/{client-PP5FETMW.js → client-DAIPF7XN.js} +4 -4
  28. package/dist/{community-report-client-KK2QBANO.js → community-report-client-M2RW4MXD.js} +2 -2
  29. package/dist/config-4VZNLBKF.js +489 -0
  30. package/dist/index.js +94 -35
  31. package/dist/memory-RWJW4XFO.js +892 -0
  32. package/dist/memory-VO2ZJCRT.js +892 -0
  33. package/dist/{metadata-JIQ77HFY.js → metadata-YGTHR2XJ.js} +8 -8
  34. package/dist/{metadata-AN3YFZEV.js → metadata-ZRN2GHPN.js} +8 -8
  35. package/dist/{model-JASQVOFD.js → model-CLUIK3K5.js} +7 -5
  36. package/dist/{raw-XJCAT3HX.js → raw-52B4UKO4.js} +8 -7
  37. package/dist/sync-3REDHGY6.js +10259 -0
  38. package/dist/{te-agent-JHUG6DVV.js → te-agent-XNPELAKX.js} +580 -84
  39. package/dist/{te-analysis-ITKTO6JS.js → te-analysis-GJI5FZUL.js} +1152 -13
  40. package/dist/{te-analysis-RAC67YYD.js → te-analysis-N2BRDJZ5.js} +1152 -13
  41. package/dist/{te-community-QOYIYEJI.js → te-community-SQXKE5OO.js} +7 -7
  42. package/dist/{te-community-UFKI6ONP.js → te-community-TYSNU3NQ.js} +7 -7
  43. package/dist/{te-dataops-PZQ5NQLY.js → te-dataops-5TM7WZDI.js} +370 -189
  44. package/dist/{te-dataops-XTWVTJCA.js → te-dataops-OWIADNSM.js} +370 -189
  45. package/dist/{te-engage-NLZUPSBK.js → te-engage-L72HWRGO.js} +716 -118
  46. package/dist/{te-engage-E7F4HTXU.js → te-engage-QWM4GFS7.js} +716 -118
  47. package/dist/{te-experiment-N63WF7XA.js → te-experiment-2T2HEZML.js} +189 -10
  48. package/dist/{te-experiment-D32TB6ZB.js → te-experiment-PVEY7AEZ.js} +189 -10
  49. package/dist/{te-kb-E7NSCBRB.js → te-kb-VRMEY3D4.js} +6 -6
  50. package/dist/{te-meta-GBDTMPEL.js → te-meta-53BVXPFI.js} +7 -7
  51. package/dist/{te-meta-ZTLTSHXC.js → te-meta-TOCBPBXI.js} +7 -7
  52. package/dist/{te-system-AH7DMCAQ.js → te-system-XGS5EQIQ.js} +4 -4
  53. package/dist/{te-team-BQ3SKSZV.js → te-team-BZRDV2CM.js} +7 -7
  54. package/dist/{update-DKG6UXEM.js → update-HEDXGOJH.js} +8 -6
  55. package/package.json +5 -2
  56. package/skills/ae-agent/SKILL.md +178 -16
  57. package/skills/ae-agent/references/add-skill.md +22 -10
  58. package/skills/ae-agent/references/edit-skill.md +24 -14
  59. package/skills/ae-agent/references/find-archived-conversations.md +82 -0
  60. package/skills/ae-agent/references/restore-conversation.md +54 -0
  61. package/skills/ae-agent/references/upload-skill.md +24 -14
  62. package/skills/ae-analysis/SKILL.md +1 -1
  63. package/skills/ae-analysis/references/command_index.md +104 -42
  64. package/skills/ae-analysis/references/entity_id_import_options.md +1 -1
  65. package/skills/ae-analysis/references/project_access_detail_get.md +3 -3
  66. package/skills/ae-analysis/references/project_data_power_delete.md +3 -3
  67. package/skills/ae-analysis/references/project_data_power_get.md +3 -3
  68. package/skills/ae-analysis/references/project_data_power_list.md +3 -3
  69. package/skills/ae-analysis/references/project_data_power_upsert.md +3 -3
  70. package/skills/ae-analysis/references/project_entity_create.md +3 -3
  71. package/skills/ae-analysis/references/project_entity_delete.md +3 -3
  72. package/skills/ae-analysis/references/project_entity_event_list.md +3 -3
  73. package/skills/ae-analysis/references/project_entity_get.md +3 -3
  74. package/skills/ae-analysis/references/project_entity_list.md +3 -3
  75. package/skills/ae-analysis/references/project_entity_update.md +3 -3
  76. package/skills/ae-analysis/references/project_function_list.md +3 -3
  77. package/skills/ae-analysis/references/project_info_create.md +25 -0
  78. package/skills/ae-analysis/references/project_info_delete.md +24 -0
  79. package/skills/ae-analysis/references/project_info_get.md +3 -3
  80. package/skills/ae-analysis/references/project_info_list.md +3 -3
  81. package/skills/ae-analysis/references/project_info_update.md +3 -3
  82. package/skills/ae-analysis/references/project_mark_time_create.md +3 -3
  83. package/skills/ae-analysis/references/project_mark_time_delete.md +3 -3
  84. package/skills/ae-analysis/references/project_mark_time_list.md +3 -3
  85. package/skills/ae-analysis/references/project_mark_time_update.md +3 -3
  86. package/skills/ae-analysis/references/project_member_add.md +3 -3
  87. package/skills/ae-analysis/references/project_member_batch_update.md +3 -3
  88. package/skills/ae-analysis/references/project_member_candidate_list.md +3 -3
  89. package/skills/ae-analysis/references/project_member_handover_export.md +3 -3
  90. package/skills/ae-analysis/references/project_member_handover_run.md +3 -3
  91. package/skills/ae-analysis/references/project_member_import.md +3 -3
  92. package/skills/ae-analysis/references/project_member_list.md +3 -3
  93. package/skills/ae-analysis/references/project_member_receiver_list.md +3 -3
  94. package/skills/ae-analysis/references/project_member_remove.md +3 -3
  95. package/skills/ae-analysis/references/project_member_update.md +3 -3
  96. package/skills/ae-analysis/references/project_owner_update.md +3 -3
  97. package/skills/ae-analysis/references/project_permission_binding_list.md +3 -3
  98. package/skills/ae-analysis/references/project_receive_status_update.md +3 -3
  99. package/skills/ae-analysis/references/project_role_delete.md +3 -3
  100. package/skills/ae-analysis/references/project_role_function_list.md +3 -3
  101. package/skills/ae-analysis/references/project_role_get.md +3 -3
  102. package/skills/ae-analysis/references/project_role_list.md +3 -3
  103. package/skills/ae-analysis/references/project_role_upsert.md +3 -3
  104. package/skills/ae-analysis/references/project_role_user_list.md +3 -3
  105. package/skills/ae-analysis/references/project_space_list.md +1 -1
  106. package/skills/ae-analysis/references/project_timezone_get.md +3 -3
  107. package/skills/ae-analysis/references/project_timezone_overview.md +3 -3
  108. package/skills/ae-analysis/references/project_timezone_update.md +3 -3
  109. package/skills/ae-analysis/references/project_user_id_items_update.md +3 -3
  110. package/skills/ae-analysis/references/system_admin_function_list.md +22 -0
  111. package/skills/ae-analysis/references/system_admin_function_update.md +26 -0
  112. package/skills/ae-analysis/references/system_admin_list.md +21 -0
  113. package/skills/ae-analysis/references/system_admin_remove.md +25 -0
  114. package/skills/ae-analysis/references/system_admin_upsert.md +25 -0
  115. package/skills/ae-analysis/references/system_function_list.md +21 -0
  116. package/skills/ae-analysis/references/system_member_add.md +25 -0
  117. package/skills/ae-analysis/references/system_member_candidate_list.md +22 -0
  118. package/skills/ae-analysis/references/system_member_delete.md +25 -0
  119. package/skills/ae-analysis/references/system_member_list.md +24 -0
  120. package/skills/ae-analysis/references/system_member_mfa_unbind.md +25 -0
  121. package/skills/ae-analysis/references/system_member_password_reset.md +32 -0
  122. package/skills/ae-analysis/references/system_member_project_batch_update.md +27 -0
  123. package/skills/ae-analysis/references/system_member_status_update.md +26 -0
  124. package/skills/ae-analysis/references/system_member_update.md +23 -0
  125. package/skills/ae-analysis/references/system_mfa_get.md +21 -0
  126. package/skills/ae-analysis/references/system_mfa_update.md +25 -0
  127. package/skills/ae-analysis/references/system_node_monitor_list.md +24 -0
  128. package/skills/ae-analysis/references/system_oauth2_update.md +22 -0
  129. package/skills/ae-analysis/references/system_ops_alert_contact_delete.md +25 -0
  130. package/skills/ae-analysis/references/system_ops_alert_contact_list.md +23 -0
  131. package/skills/ae-analysis/references/system_ops_alert_contact_test.md +29 -0
  132. package/skills/ae-analysis/references/system_ops_alert_contact_upsert.md +39 -0
  133. package/skills/ae-analysis/references/system_preference_get.md +21 -0
  134. package/skills/ae-analysis/references/system_preference_update.md +22 -0
  135. package/skills/ae-analysis/references/system_project_usage_list.md +28 -0
  136. package/skills/ae-analysis/references/system_query_alert_rule_list.md +21 -0
  137. package/skills/ae-analysis/references/system_query_alert_rule_update.md +26 -0
  138. package/skills/ae-analysis/references/system_query_monitor_overview.md +26 -0
  139. package/skills/ae-analysis/references/system_query_task_cancel.md +25 -0
  140. package/skills/ae-analysis/references/system_query_task_export.md +49 -0
  141. package/skills/ae-analysis/references/system_query_task_get.md +23 -0
  142. package/skills/ae-analysis/references/system_query_task_list.md +35 -0
  143. package/skills/ae-analysis/references/system_query_task_options.md +27 -0
  144. package/skills/ae-analysis/references/system_receiver_address_delete.md +26 -0
  145. package/skills/ae-analysis/references/system_receiver_address_overview.md +21 -0
  146. package/skills/ae-analysis/references/system_receiver_address_project_list.md +21 -0
  147. package/skills/ae-analysis/references/system_receiver_address_promote.md +24 -0
  148. package/skills/ae-analysis/references/system_receiver_address_upsert.md +27 -0
  149. package/skills/ae-analysis/references/system_receiver_detection_get.md +22 -0
  150. package/skills/ae-analysis/references/system_receiver_detection_run.md +22 -0
  151. package/skills/ae-analysis/references/system_receiver_detection_update.md +25 -0
  152. package/skills/ae-analysis/references/system_role_delete.md +26 -0
  153. package/skills/ae-analysis/references/system_role_function_list.md +22 -0
  154. package/skills/ae-analysis/references/system_role_get.md +22 -0
  155. package/skills/ae-analysis/references/system_role_list.md +24 -0
  156. package/skills/ae-analysis/references/system_role_upsert.md +27 -0
  157. package/skills/ae-analysis/references/system_role_user_list.md +22 -0
  158. package/skills/ae-analysis/references/system_seat_list.md +25 -0
  159. package/skills/ae-analysis/references/system_seat_update.md +26 -0
  160. package/skills/ae-analysis/references/system_smtp_delete.md +24 -0
  161. package/skills/ae-analysis/references/system_smtp_get.md +21 -0
  162. package/skills/ae-analysis/references/system_smtp_test.md +22 -0
  163. package/skills/ae-analysis/references/system_smtp_upsert.md +31 -0
  164. package/skills/ae-analysis/references/system_third_party_login_disable.md +25 -0
  165. package/skills/ae-analysis/references/system_third_party_login_list.md +21 -0
  166. package/skills/ae-analysis/references/system_third_party_login_upsert.md +33 -0
  167. package/skills/ae-analysis/references/system_usage_overview.md +21 -0
  168. package/skills/ae-analysis/references/system_usage_trend_export.md +44 -0
  169. package/skills/ae-analysis/references/system_usage_trend_query.md +28 -0
  170. package/skills/ae-dataops/SKILL.md +1 -1
  171. package/skills/ae-dataops/references/dataops-flow-create.md +51 -16
  172. package/skills/ae-engage/SKILL.md +67 -27
  173. package/skills/ae-engage/references/activity-activity.md +3 -0
  174. package/skills/ae-engage/references/activity-approval.md +12 -4
  175. package/skills/ae-engage/references/activity-data-detail.md +61 -0
  176. package/skills/ae-engage/references/activity-task.md +21 -6
  177. package/skills/ae-engage/references/activity-topic.md +31 -13
  178. package/skills/ae-engage/references/add-channel.md +170 -41
  179. package/skills/ae-engage/references/build-task-save-guide.md +66 -29
  180. package/skills/ae-engage/references/channel-update-config.md +3 -2
  181. package/skills/ae-engage/references/common-metric.md +88 -115
  182. package/skills/ae-engage/references/flow-detail.md +13 -0
  183. package/skills/ae-engage/references/preset-event.md +14 -32
  184. package/skills/ae-engage/references/save-flow.md +141 -64
  185. package/skills/ae-engage/references/save-task.md +231 -58
  186. package/skills/ae-engage/references/scene-config-metric.md +3 -0
  187. package/skills/ae-engage/references/scene-preset-metric.md +8 -37
  188. package/skills/ae-engage/references/scene-strategy-audience.md +56 -643
  189. package/skills/ae-engage/references/scene-strategy.md +6 -6
  190. package/skills/ae-engage/references/task-detail.md +10 -0
  191. package/skills/ae-engage/references/task-submit-approval.md +45 -0
  192. package/skills/ae-engage/references/validate-flow-node-config.md +1 -1
  193. package/skills/ae-experiment/SKILL.md +38 -5
  194. package/skills/ae-experiment/references/check_experiment_ready.md +2 -0
  195. package/skills/ae-experiment/references/delete_metric.md +2 -0
  196. package/skills/ae-experiment/references/query_experiment_detail.md +6 -0
  197. package/skills/ae-experiment/references/query_experiment_list.md +4 -0
  198. package/skills/ae-experiment/references/query_experiment_list_archived.md +3 -0
  199. package/skills/ae-experiment/references/query_experiment_metric_trend.md +5 -5
  200. package/skills/ae-experiment/references/query_experiment_report_summary.md +4 -3
  201. package/skills/ae-experiment/references/query_experiment_sample_size_report.md +6 -5
  202. package/skills/ae-experiment/references/query_metric_detail.md +5 -0
  203. package/skills/ae-experiment/references/query_metric_list.md +3 -0
  204. package/skills/ae-experiment/references/save_build_guide.md +39 -0
  205. package/skills/ae-experiment/references/save_experiment.md +53 -3
  206. package/skills/ae-experiment/references/save_metric.md +67 -1
  207. package/skills/ae-experiment/references/save_submit_experiment.md +3 -0
  208. package/skills/ae-experiment/references/save_validate.md +33 -0
  209. package/skills/ae-experiment-design/SKILL.md +149 -0
  210. package/skills/ae-experiment-design/agents/openai.yaml +4 -0
  211. package/skills/ae-experiment-design/references/client-experiment-sdk.md +147 -0
  212. package/skills/ae-experiment-design/references/experiment-creation.md +108 -0
  213. package/skills/ae-experiment-design/references/experiment-sdk-contract.md +100 -0
  214. package/skills/ae-experiment-design/references/exposure-contract.md +91 -0
  215. package/skills/ae-experiment-design/references/hybrid-experiment-sdk.md +74 -0
  216. package/skills/ae-experiment-design/references/metric-readiness.md +143 -0
  217. package/skills/ae-experiment-design/references/platform-operations.md +105 -0
  218. package/skills/ae-experiment-design/references/sdk-index.md +76 -0
  219. package/skills/ae-experiment-design/references/sdk-integration.md +114 -0
  220. package/skills/ae-experiment-design/references/sdk-troubleshooting.md +139 -0
  221. package/skills/ae-experiment-design/references/server-experiment-sdk.md +78 -0
  222. package/skills/ae-experiment-design/scripts/calculate_experiment_plan.py +450 -0
  223. package/skills/ae-experiment-insight/SKILL.md +149 -0
  224. package/skills/ae-experiment-insight/agents/openai.yaml +4 -0
  225. package/skills/ae-experiment-insight/references/decision-framework.md +69 -0
  226. package/skills/ae-experiment-insight/references/diagnostic-playbook.md +225 -0
  227. package/skills/ae-experiment-insight/references/platform-operations.md +82 -0
  228. package/skills/ae-experiment-insight/scripts/analyze_experiment.py +478 -0
  229. package/skills/ae-generate-tracking-code/SKILL.md +2 -2
  230. package/skills/ae-metadata/SKILL.md +1 -1
  231. package/dist/config-BSSALXEN.js +0 -128
  232. package/dist/sync-QFP4XFN3.js +0 -485
@@ -0,0 +1,149 @@
1
+ ---
2
+ name: ae-experiment-design
3
+ description: "Design AE/TE A/B experiments from a business goal through a reviewable draft. Use when the user asks to form an experiment hypothesis, assess metric readiness, choose or create metrics and Features, design groups or traffic, estimate sample size or duration, create an experiment draft, or run readiness and conflict checks. SDK guidance is a conditional branch: enter it only when the user explicitly asks about an A/B experiment SDK, client SDK integration, experiment SDK code generation, or SDK troubleshooting; do not include SDK work in an ordinary experiment-design or draft-creation request."
4
+ ---
5
+
6
+ # AE Experiment Design and Integration
7
+
8
+ Turn a business objective into an evidence-backed experiment design, an implementation contract, and, when requested and supported, an AE experiment draft.
9
+
10
+ ## Hard boundaries
11
+
12
+ - Use `ae-cli` for every AE/TE platform interaction. Do not substitute raw HTTP, browser automation, direct database queries, MCP tools, or application SDKs.
13
+ - Do not infer an SDK request from the fact that an experiment needs implementation. Load SDK references only when the user explicitly asks about an A/B experiment SDK or client SDK integration.
14
+ - Do not copy general tracking SDK documentation into this Skill. Route generic initialization, event reporting, `track`, user identity, user properties, data upload, LogBus, and REST questions to `ae-data-integration-helper` when that Skill is available.
15
+ - Use only the event-metric calculation contracts defined in
16
+ `metric-readiness.md`. Bind one confirmed primary event metric and do not add
17
+ unsupported metric roles.
18
+ - Never claim that a platform asset exists, was created, passed a check, or generated project code without a successful `ae-cli` response.
19
+ - Never invent platform IDs, schemas, SDK APIs, versions, defaults, or behavior.
20
+
21
+ ## Progressive disclosure router
22
+
23
+ Read only the references needed for the current request:
24
+
25
+ | Request | Required references |
26
+ |---|---|
27
+ | Any AE/TE platform read or write | [`references/platform-operations.md`](references/platform-operations.md) |
28
+ | Create or reuse an experiment draft | [`references/experiment-creation.md`](references/experiment-creation.md) and [`references/platform-operations.md`](references/platform-operations.md) |
29
+ | Metric selection, feasibility, or creation | [`references/metric-readiness.md`](references/metric-readiness.md) |
30
+ | Explicit A/B experiment SDK or client SDK integration request | [`references/sdk-integration.md`](references/sdk-integration.md) |
31
+ | Exact SDK version, dependency, class, or source lookup | [`references/sdk-index.md`](references/sdk-index.md) |
32
+ | Cross-platform Feature, default, fetch, cache, or assignment behavior | [`references/experiment-sdk-contract.md`](references/experiment-sdk-contract.md) |
33
+ | Android, iOS, or JavaScript experiment SDK | [`references/client-experiment-sdk.md`](references/client-experiment-sdk.md) |
34
+ | Server-side assignment or evaluation | [`references/server-experiment-sdk.md`](references/server-experiment-sdk.md) |
35
+ | Server assignment with client rendering | [`references/hybrid-experiment-sdk.md`](references/hybrid-experiment-sdk.md) |
36
+ | Exposure design, deduplication, or metric join | [`references/exposure-contract.md`](references/exposure-contract.md) |
37
+ | SDK retrieval, default, identity, exposure, or debug issue | [`references/sdk-troubleshooting.md`](references/sdk-troubleshooting.md) |
38
+
39
+ References are a curated fast path, not the whole documentation set.
40
+
41
+ ## Workflow
42
+
43
+ ### 1. Frame the decision
44
+
45
+ Extract:
46
+
47
+ - business goal and desired direction;
48
+ - experiment variable and user-visible change;
49
+ - target population and exclusions;
50
+ - decision that the result must support;
51
+ - success threshold.
52
+
53
+ Convert these into a falsifiable hypothesis. Clarify only missing facts that materially change the design. For a conversion goal, establish the population, denominator or exposure behavior, numerator behavior, attribution window, and analysis unit.
54
+
55
+ Do not silently invent a target population, conversion definition, or technical platform.
56
+
57
+ ### 2. Resolve the project and evidence
58
+
59
+ Pass the project gate in `platform-operations.md`. With `ae-cli`, establish candidate exposure and outcome events, assignment identity and join path, timestamps, exact saved-metric definitions, and—when available—baseline and eligible traffic.
60
+
61
+ If the project is unavailable, accept user-provided schemas or definitions and label all platform-dependent conclusions as unverified.
62
+
63
+ ### 3. Assess metric readiness
64
+
65
+ Apply `metric-readiness.md`. Classify candidates as `recommended`, `available`,
66
+ `blocked`, or `unverified`; recommend one primary event metric and confirm its
67
+ calculation code before planning sample size or duration.
68
+
69
+ ### 4. Design Feature, assignment, and groups
70
+
71
+ Define the Feature key, type, typed default, ownership, stable assignment unit, one control group, treatment groups, group values, traffic, allocations, layer, targeting, and exclusions.
72
+
73
+ Require allocations totaling `1.0`, experiment traffic in `(0, 1]`, type-correct values, a stable exposure-to-outcome identity join, and at least one primary metric. Resolve real Features and layers with `ae-cli` before reuse or creation.
74
+
75
+ ### 5. Calculate sample size and duration
76
+
77
+ Follow this order: confirm the primary metric and calculation code → obtain its
78
+ baseline, MDE, and any required variance → calculate the sample target with
79
+ [`scripts/calculate_experiment_plan.py`](scripts/calculate_experiment_plan.py)
80
+ → derive duration from the sample target and effective eligible daily units.
81
+ Apply the preregistered planning policy in `metric-readiness.md`. Use fixed
82
+ `alpha=0.05` and two-sided testing, policy-default `power=0.80`, and Bonferroni
83
+ planning for multiple treatments. Require the MDE type and direction; never
84
+ default MDE to 5% or assume variance for a continuous metric.
85
+
86
+ When experiment traffic is already confirmed, calculate its duration. When it
87
+ is not confirmed, obtain verified layer capacity and let the script recommend
88
+ the smallest absolute traffic candidate that reaches the target within the
89
+ maximum runtime. Default to at least seven days and full-week alignment. Return
90
+ the actual infeasible duration instead of truncating it. Explain the baseline,
91
+ MDE, power source, allocations, multiplicity rule, traffic evidence, sample
92
+ targets, duration adjustment, and any native-report mismatch. Do not return a
93
+ definitive plan when required evidence is unavailable.
94
+
95
+ ### 6. Materialize the design
96
+
97
+ For an explicit draft-creation request, follow `experiment-creation.md` and `platform-operations.md`. Create only authorized draft assets, verify the saved result by reading it back, run supported readiness and conflict checks, and return the compact receipt and experiment link defined there.
98
+
99
+ Submitting, starting, changing live traffic, pausing, ending, or deleting requires separate explicit confirmation. Never turn draft creation into launch.
100
+
101
+ ## Output requirements
102
+
103
+ - Use the language explicitly requested by the user. Otherwise, use the language of the user's latest substantive message.
104
+ - Localize all user-visible prose, including headings, table headers, field labels, status names, recommendations, warnings, assumptions, and next actions.
105
+ - Keep code, commands, raw IDs, event/property/metric names, Feature keys, SDK/API names, and official enum values unchanged when translation would alter their technical meaning.
106
+ - Treat section names in this Skill as semantic guidance, not literal output text. Do not copy an English heading into a non-English response.
107
+ - For a design request, lead with the experiment recommendation. For a creation, validation, or conflict-check request, lead with the operation outcome.
108
+ - Include only the smallest set of relevant sections; do not reproduce every workflow stage.
109
+ - Separate observed platform evidence, verified documentation, deterministic calculations, design judgments, and unresolved assumptions.
110
+ - Before responding, check every heading, table header, label, and status for unintended mixed-language output.
111
+
112
+ Treat project resolution, metadata discovery, candidate-event searches, metric comparison, Feature and layer inventory, capability discovery, schema inspection, and command execution as internal working context.
113
+
114
+ - Do not narrate the execution sequence in the final answer. Omit phrases such as "first load the reference", "now query in parallel", "verified with ae-cli", or "the evidence collection is complete".
115
+ - Do not expose raw commands, capability IDs, request schemas, full candidate lists, or a platform-evidence dump unless the user explicitly asks for the evidence, audit trail, or debugging details.
116
+ - Surface platform evidence only when it changes the design, blocks the operation, reveals a material semantic mismatch, or requires user confirmation. Summarize it in at most three concise bullets by default.
117
+ - Do not repeat the full experiment design after a creation request unless the user explicitly asks for the complete design.
118
+ - Do not expose hidden reasoning. Give the conclusion, the user-relevant basis, and the action result.
119
+
120
+ ## Failure behavior
121
+
122
+ - Missing project or ambiguous host: show candidates and ask; do not guess.
123
+ - Missing metadata: return the required event, property, identity, and timestamp checklist.
124
+ - Experiment product unavailable:
125
+ - State that the project has not enabled the experiment product only when an
126
+ explicit platform entitlement result establishes that fact. A missing
127
+ capability alone means the experiment capability is unavailable, not that
128
+ the product was not purchased.
129
+ - For a design request, tell the user that experiment design can continue,
130
+ but Feature, layer, metric, and traffic details cannot be verified on the
131
+ platform. Continue with an offline design and request the baseline, MDE,
132
+ and eligible daily units when sample-size or duration planning needs them.
133
+ - For a draft-creation request, lead with the outcome that the experiment
134
+ draft was not created. Explain that Feature, layer, and draft creation are
135
+ blocked, preserve the proposed design, and say that platform creation and
136
+ readiness checks can continue after the product is enabled or the required
137
+ access is granted.
138
+ - HTTP 403 or equivalent permission denial: state that the current account
139
+ lacks the required experiment permission, stop dependent writes, and explain
140
+ that this result does not establish whether the project purchased the
141
+ experiment product. Ask the project administrator to check both product
142
+ availability and the user's project permissions.
143
+ - Capability gap without an explicit entitlement or permission result: report
144
+ that the current environment does not expose the required experiment
145
+ capability, continue with an offline design when useful, and do not bypass
146
+ `ae-cli`.
147
+ - For SDK gaps or conflicts, follow `sdk-integration.md`; do not invent exact code.
148
+ - Validation failure: correct documented input or ask for the missing value; do not retry unchanged input.
149
+ - Partial success: report created and failed assets separately and never imply atomic success.
@@ -0,0 +1,4 @@
1
+ interface:
2
+ display_name: "Experiment Design & Integration"
3
+ short_description: "Design AE experiments with optional SDK guidance"
4
+ default_prompt: "Use $ae-experiment-design to design an A/B experiment and prepare an AE draft; include SDK guidance only when I explicitly request it."
@@ -0,0 +1,147 @@
1
+ # Client Experiment SDK
2
+
3
+ Read this reference for Android, iOS, or browser JavaScript experiment integration. Read `sdk-index.md` first and verify the current main document before producing production code.
4
+
5
+ ## Shared client model
6
+
7
+ All three verified client pages describe the same model:
8
+
9
+ - analytics SDK handles data collection;
10
+ - Remote Config retrieves AE configuration;
11
+ - experiment SDK provides typed Feature getters and exposure;
12
+ - automatic exposure is enabled through `automaticExposureTracking`;
13
+ - manual exposure is available when activation does not coincide with the getter;
14
+ - a custom bucket map can override the default assignment subject;
15
+ - custom fetch parameters can be attached to configuration requests;
16
+ - an explicit fetch can refresh experiment information.
17
+
18
+ ## Android
19
+
20
+ Verified document state: `TDExperiment` 1.0.1, updated 2026-07-24.
21
+
22
+ Dependencies:
23
+
24
+ - `TDAnalytics` >= 3.3.6
25
+ - `TDRemoteConfig` >= 1.3.0
26
+ - automatic package: `cn.thinkingdata.android:TDExperiment:1.0.1`
27
+
28
+ Initialization order:
29
+
30
+ ```java
31
+ TDAnalytics.init(context, "APP_ID", "https://YOUR_SERVER_URL");
32
+
33
+ TDExperimentConfig config =
34
+ new TDExperimentConfig("APP_ID", "https://YOUR_SERVER_URL");
35
+ config.automaticExposureTracking = true;
36
+ TDExperiment.init(context, config);
37
+ ```
38
+
39
+ Verified operations:
40
+
41
+ ```java
42
+ TDExperiment.getValueAsString(key);
43
+ TDExperiment.getValueAsDouble(key);
44
+ TDExperiment.getValueAsBoolean(key);
45
+ TDExperiment.getValueAsJson(key);
46
+ TDExperiment.exposure(key);
47
+ TDExperiment.fetch();
48
+ TDExperiment.setCustomBucketId(bucketId);
49
+ TDExperiment.setCustomFetchParams(params);
50
+ ```
51
+
52
+ Use the initialization callback for first-fetch success or error. `TDExperiment.enableLog(true)` enables experiment logging.
53
+
54
+ The verified page does not show typed-default overloads for Android getters. Keep an application-owned typed control default and verify whether a newer SDK adds overloads.
55
+
56
+ ## iOS
57
+
58
+ Verified document state: `TDExperiment` 1.0.2, updated 2026-07-24.
59
+
60
+ Dependencies:
61
+
62
+ - `ThinkingSDK` >= 3.1.6
63
+ - `TDRemoteConfig` >= 1.3.1
64
+ - CocoaPods: `pod 'TDExperiment', '1.0.2'`
65
+ - minimum deployment target shown by the experiment page: iOS 9.0
66
+
67
+ Initialization order:
68
+
69
+ ```objective-c
70
+ [TDAnalytics startAnalyticsWithAppId:@"APP_ID"
71
+ serverUrl:@"https://YOUR_SERVER_URL"];
72
+
73
+ TDExperimentConfig *config =
74
+ [[TDExperimentConfig alloc] initWithAppId:@"APP_ID"
75
+ serverUrl:@"https://YOUR_SERVER_URL"];
76
+ config.automaticExposureTracking = YES;
77
+ [TDExperiment startWithConfig:config];
78
+ ```
79
+
80
+ Verified getters support no-argument defaults and explicit defaults:
81
+
82
+ ```objective-c
83
+ [TDExperiment getValueAsString:key defaultValue:@"default"];
84
+ [TDExperiment getValueAsNumber:key defaultValue:@0];
85
+ [TDExperiment getValueAsBoolean:key defaultValue:NO];
86
+ [TDExperiment getValueAsJson:key defaultValue:@{}];
87
+ ```
88
+
89
+ Other verified operations:
90
+
91
+ ```objective-c
92
+ [TDExperiment exposure:key];
93
+ [TDExperiment fetch];
94
+ [TDExperiment setCustomBucketId:bucketId];
95
+ [TDExperiment setCustomFetchParams:params];
96
+ ```
97
+
98
+ Use `TDExperimentTask` listeners for startup or fetch success and failure. `[TDExperiment enableLog:YES]` enables experiment logging.
99
+
100
+ ## JavaScript
101
+
102
+ Verified document state: experiment package 1.0.0, updated 2026-07-24.
103
+
104
+ Dependencies:
105
+
106
+ - `TDAnalytics` >= 2.6.0
107
+ - `TDRemoteconfig` >= 1.3.0
108
+ - files shown by the page: `thinkingdata.umd.min.js`, `tdremoteconfig.umd.min.js`, `tdexperiment.umd.min.js`
109
+
110
+ The page initializes analytics first and then the experiment global with:
111
+
112
+ - `appId`
113
+ - `serverUrl`
114
+ - `automaticExposureTracking`
115
+ - `customBucketId`
116
+ - `customFetchParams`
117
+ - `enableLog`
118
+ - fetch success and failure callbacks
119
+
120
+ The page shows typed getters, manual exposure, fetch, custom bucket ID, and custom fetch parameters.
121
+
122
+ ### Spelling gate
123
+
124
+ The verified page spells the global object `TDExpriment`. Treat this as unresolved until the downloaded 1.0.0 package or a newer verified main document confirms the export. Do not silently change it, and do not publish exact JavaScript code based only on the page.
125
+
126
+ ## Remote Config companion behavior
127
+
128
+ The verified Remote Config pages show:
129
+
130
+ - local defaults when no remote value is available;
131
+ - value order: remote, local default, then empty;
132
+ - a successful-fetch update listener;
133
+ - status information for strategies changed to `suspend` or `force_offline`;
134
+ - debug/test mode polling every five seconds for test strategies;
135
+ - test-device selection for client send testing.
136
+
137
+ These are Remote Config behaviors. Do not imply that the experiment SDK itself polls every five seconds in production.
138
+
139
+ ## Client implementation checklist
140
+
141
+ - Verify all three SDK versions together.
142
+ - Initialize on the documented thread or lifecycle point.
143
+ - Set assignment identity before first fetch or getter.
144
+ - Use a typed control default.
145
+ - Choose automatic or manual exposure, not both.
146
+ - Freeze behavior when a mid-session update would cause flicker.
147
+ - Test control, treatment, no-network, timeout, account switch, and stale-cache cases.
@@ -0,0 +1,108 @@
1
+ # Experiment Draft Creation
2
+
3
+ Use this reference when the user asks to create, save, or reuse an A/B experiment draft.
4
+
5
+ ## Execution boundary
6
+
7
+ - Perform every platform read or write through `ae-cli`.
8
+ - Discover and inspect the current capability before constructing input.
9
+ - Do not assume Feature, layer, metric, group, targeting, duration, or traffic fields before inspecting the current schema.
10
+
11
+ ## Creation contract gate
12
+
13
+ Before writing a draft, establish the minimum semantic contract:
14
+
15
+ 1. verified project ID and host;
16
+ 2. experiment variable and the user-visible or system behavior that changes;
17
+ 3. experiment goal and one primary metric with an exact feasible definition;
18
+ 4. target population and material exclusions;
19
+ 5. stable assignment unit and identity join path;
20
+ 6. one control group and at least one treatment group, with typed Feature values and allocations totaling `1.0`;
21
+ 7. experiment traffic, targeting, and a resolved layer or explicit new-layer plan;
22
+ 8. Feature ownership, key, type, and typed default;
23
+ 9. when the draft requires a duration, a confirmed sample target and
24
+ formula-derived duration.
25
+
26
+ Do not create a prose-only shell that leaves the experiment variable, group behavior, primary metric, target population, or assignment identity undefined. Ask one focused question at a time when a missing answer materially changes the draft.
27
+
28
+ ## Design heuristics are not platform facts
29
+
30
+ Use these only as recommendations and verify that the identity exists and remains stable:
31
+
32
+ - pre-login experience: usually `#distinct_id` or a stable device identity;
33
+ - authenticated user experience: usually `#user_id`;
34
+ - account-wide B2B behavior: an account identity;
35
+ - device-specific rendering or performance: a device identity.
36
+
37
+ Do not silently choose an assignment identity. Explain the material identity risk and obtain confirmation when more than one viable identity changes who receives a consistent experience.
38
+
39
+ ## Authorization gate
40
+
41
+ A draft write is authorized when either condition holds:
42
+
43
+ - the user reviewed the proposed design and then explicitly asked to create or confirmed creation; or
44
+ - the user's current request explicitly says to create and already provides an exact, complete creation contract.
45
+
46
+ If the design contains recommended or inferred choices that the user has not reviewed and those choices materially affect assignment, audience, behavior, metrics, or traffic, show a compact plan summary and ask for confirmation before writing.
47
+
48
+ Do not ask for redundant confirmation when the user has already confirmed the unchanged plan. Design-only language is not authorization to create. Draft authorization never authorizes submit, start, live traffic changes, pause, end, or delete.
49
+
50
+ ## Resolution and idempotency
51
+
52
+ Before creating assets:
53
+
54
+ 1. resolve the project;
55
+ 2. search for exact or likely duplicate experiment drafts;
56
+ 3. inspect any likely duplicate before deciding to reuse it;
57
+ 4. resolve the exact Feature, layer, and metrics;
58
+ 5. verify definitions, types, defaults, ownership, status, and remaining traffic;
59
+ 6. identify existing active or draft experiments that may interact with the same Feature, layer, audience, or identity.
60
+
61
+ Reuse only an exact semantic match. Similar names are not enough. If an exact-match draft already exists, reuse it and report that outcome instead of creating a duplicate.
62
+
63
+ An empty list is not proof of no conflict. Only a supported conflict check can justify a user-facing "no conflict" result.
64
+
65
+ ## Materialization sequence
66
+
67
+ Use the inspected schemas and execute only the steps required for this design:
68
+
69
+ 1. create or reuse an exact metric when its definition is complete;
70
+ 2. create or reuse an inactive Feature with the correct type and default;
71
+ 3. create or reuse a compatible layer with verified assignment identity and sufficient traffic;
72
+ 4. assemble experiment name, falsifiable hypothesis, Feature bindings, groups, allocations, traffic, targeting, metrics, and any required schedule fields;
73
+ 5. validate or dry-run once when appropriate under `platform-operations.md`;
74
+ 6. save the experiment as a draft;
75
+ 7. read back the draft and verify its persisted fields;
76
+ 8. run supported readiness and conflict checks;
77
+ 9. return a concise creation receipt and experiment-detail link.
78
+
79
+ Do not claim atomic success when supporting assets were created but the experiment save failed. Report created, reused, failed, and unresolved assets separately.
80
+ Immediately before saving, revalidate the creation contract against the inspected schema and ensure no proposed ID is being presented as an existing platform ID.
81
+
82
+ ## Post-save verification
83
+
84
+ A successful write response is not sufficient by itself. Read back the saved or reused draft and verify, when returned by the platform:
85
+
86
+ - actual experiment ID and name;
87
+ - project ID;
88
+ - draft status;
89
+ - Feature and layer bindings;
90
+ - group names, values, and allocations;
91
+ - experiment traffic and targeting;
92
+ - primary event metric and calculation code.
93
+
94
+ Run readiness and conflict checks only when supported. Report each check separately and do not translate "not run" into "passed".
95
+
96
+ ## User-visible completion
97
+
98
+ Return an operation receipt, not the discovery log. Include:
99
+
100
+ - created, reused, partially completed, blocked, or failed;
101
+ - experiment name, actual ID, and draft status;
102
+ - control and treatment values and allocations;
103
+ - experiment traffic and primary metric;
104
+ - readiness and conflict results that actually ran;
105
+ - at most three material blockers or semantic risks;
106
+ - the clickable experiment-detail link required by `SKILL.md`.
107
+
108
+ Do not expose raw candidate lists, capability discovery, request schemas, commands, or internal execution narration unless the user explicitly asks for an audit or debugging view.
@@ -0,0 +1,100 @@
1
+ # Experiment SDK Contract
2
+
3
+ Read this reference when defining Feature retrieval, assignment, defaults, caching, or cross-platform behavior.
4
+
5
+ ## Required sequence
6
+
7
+ 1. Initialize the analytics SDK.
8
+ 2. Initialize the Remote Config dependency.
9
+ 3. Initialize the experiment SDK with the same verified app and server environment.
10
+ 4. Establish the stable assignment identity before the first Feature evaluation.
11
+ 5. Fetch or read the Feature using the expected value type.
12
+ 6. Apply the assigned behavior.
13
+ 7. Record exposure only when the behavior becomes visible or effective.
14
+ 8. Report outcome events with an identity that can join to exposure.
15
+
16
+ The verified Android and iOS experiment documents explicitly require analytics initialization before experiment initialization. Apply the same ordering to JavaScript unless a newer verified main document states otherwise.
17
+
18
+ ## Feature contract
19
+
20
+ Define the following before implementation:
21
+
22
+ | Field | Requirement |
23
+ |---|---|
24
+ | Feature key | Stable, environment-correct, and resolved from the real platform asset |
25
+ | Value type | String, number, Boolean, or JSON; match the platform Feature |
26
+ | Default | Typed, safe for control behavior, and owned by the application |
27
+ | Assignment unit | Stable device, account, role, or another verified identifier |
28
+ | Evaluation owner | Client, server, or one side of a hybrid architecture |
29
+ | Exposure owner | Exactly one component |
30
+ | Outcome join | Same stable identity or a verified merge path |
31
+
32
+ Do not use an empty or null fallback when a safe control behavior is required. A default is product behavior, not only an SDK parameter.
33
+
34
+ ## Assignment identity
35
+
36
+ Resolve:
37
+
38
+ - pre-login identity;
39
+ - post-login identity;
40
+ - account switching;
41
+ - multiple roles under one account;
42
+ - device-to-account merge or alias behavior;
43
+ - server/client identity consistency.
44
+
45
+ If a custom bucket ID is used, set it before fetching or reading the Feature. The verified client SDKs expose a custom bucket map, but the exact key and value semantics must match the experiment configuration. Do not assume that the literal example `bucket_id -> account_id` is the only supported schema.
46
+
47
+ Do not use custom request parameters as a hidden substitute for assignment identity unless the platform contract explicitly defines that behavior.
48
+
49
+ ## Fetch and cache
50
+
51
+ Define:
52
+
53
+ - initial fetch timing;
54
+ - request timeout;
55
+ - retry and backoff;
56
+ - last-known-good cache;
57
+ - cache freshness;
58
+ - whether a stale value may be used;
59
+ - whether a mid-session update can change behavior;
60
+ - control fallback when no value is available.
61
+
62
+ Avoid UI flicker and treatment changes after the user has already seen control. For a session-scoped experience, freeze the evaluated value for the session unless the product requirement explicitly allows live changes.
63
+
64
+ Remote Config documentation establishes the general fallback order for configuration keys:
65
+
66
+ 1. remote value;
67
+ 2. local default;
68
+ 3. empty when neither exists.
69
+
70
+ For an experiment Feature, prefer an explicit typed application default even when the platform SDK offers an overload or local default store.
71
+
72
+ ## Exposure
73
+
74
+ Configuration retrieval is not exposure. A getter that automatically reports exposure is valid only if calling the getter coincides with applying the assigned behavior. If the application reads early, preloads, branches later, or may discard the result, disable automatic exposure and use manual exposure at the true activation point.
75
+
76
+ Read `exposure-contract.md` before finalizing exposure behavior.
77
+
78
+ ## Custom fetch parameters
79
+
80
+ Use custom fetch parameters only for fields supported by the client configuration channel. Document:
81
+
82
+ - field name and type;
83
+ - source of truth;
84
+ - whether it affects targeting, diagnostics, or payload enrichment;
85
+ - privacy classification;
86
+ - behavior when absent.
87
+
88
+ Never place secrets or unstable session values in custom fetch parameters.
89
+
90
+ ## Acceptance checks
91
+
92
+ - Analytics, Remote Config, and experiment SDK versions are compatible.
93
+ - Initialization uses the intended app and environment.
94
+ - The control default is returned when configuration is unavailable.
95
+ - A test identity receives a stable group across sessions.
96
+ - Client and server agree for the same assignment identity.
97
+ - Exposure occurs once at treatment activation, not at preload.
98
+ - Outcome events join to exposure.
99
+ - Account switching does not leak the previous account’s assignment.
100
+ - Debug logging and test mode are disabled or production-safe before release.
@@ -0,0 +1,91 @@
1
+ # Experiment Exposure Contract
2
+
3
+ Read this reference whenever exposure affects assignment, metrics, SDK code, or rollout readiness.
4
+
5
+ ## Exposure definition
6
+
7
+ Exposure means the assigned behavior was actually rendered or became effective for the analysis unit. It is not:
8
+
9
+ - SDK initialization;
10
+ - configuration fetch;
11
+ - Feature preload;
12
+ - getter execution when the result may be discarded;
13
+ - assignment calculation without treatment activation.
14
+
15
+ ## Automatic versus manual exposure
16
+
17
+ The verified Android, iOS, and JavaScript experiment pages state that a typed getter automatically uploads exposure when `automaticExposureTracking` is enabled.
18
+
19
+ Use automatic exposure only when the getter is called at the same decision point where the value is applied.
20
+
21
+ Use manual exposure when:
22
+
23
+ - values are prefetched;
24
+ - a getter is called before eligibility is final;
25
+ - the result may not render;
26
+ - the server assigns but the client activates;
27
+ - one value is read multiple times before a single activation;
28
+ - the product needs a later, explicit effective point.
29
+
30
+ Do not combine automatic getter exposure and manual exposure for the same activation.
31
+
32
+ ## Exposure owner
33
+
34
+ Choose exactly one:
35
+
36
+ - client rendering owner;
37
+ - server behavior owner;
38
+ - another verified activation service.
39
+
40
+ Document why that component knows the treatment became effective.
41
+
42
+ ## Deduplication contract
43
+
44
+ Define an application-level deduplication key from stable facts such as:
45
+
46
+ - project and environment;
47
+ - experiment or Feature;
48
+ - assignment identity;
49
+ - assignment or group;
50
+ - activation scope such as session, page instance, or decision instance.
51
+
52
+ Do not invent AE event property names. Let the verified SDK emit its supported schema, or resolve the exposure event contract through `ae-cli`.
53
+
54
+ Retry must be idempotent at the chosen activation scope.
55
+
56
+ ## Identity and join
57
+
58
+ The identity used for assignment, exposure, and outcome must either be the same or have a verified merge path.
59
+
60
+ Block launch when:
61
+
62
+ - anonymous and logged-in identities can cross groups;
63
+ - server and client use different assignment subjects;
64
+ - exposure uses device identity while outcomes use an unlinked account identity;
65
+ - account switching can inherit a cached assignment;
66
+ - the analysis unit cannot be reconstructed from platform evidence.
67
+
68
+ ## Outcome contract
69
+
70
+ For the confirmed primary event metric, define:
71
+
72
+ - event or measure;
73
+ - identity;
74
+ - timestamp;
75
+ - attribution window;
76
+ - denominator or eligible population;
77
+ - relation to exposure;
78
+ - duplicate and late-event treatment.
79
+
80
+ Do not report an exposure merely to force a user into the denominator. Fix the metric or eligibility contract instead.
81
+
82
+ ## Acceptance tests
83
+
84
+ - Getter without rendering does not produce exposure in manual mode.
85
+ - Rendering produces one exposure.
86
+ - Re-render behavior matches the pre-registered exposure scope.
87
+ - Retry does not create duplicate logical exposure.
88
+ - Control and treatment exposure are both observable.
89
+ - Assignment proportions match configured allocation.
90
+ - Exposure and outcome join for anonymous, login, logout, and account-switch paths.
91
+ - Offline and delayed-upload behavior is understood before launch.
@@ -0,0 +1,74 @@
1
+ # Hybrid Experiment Architecture
2
+
3
+ Read this reference when the server assigns or prepares a variant but the client renders or activates the treatment.
4
+
5
+ ## Ownership model
6
+
7
+ Assign one owner for each responsibility:
8
+
9
+ | Responsibility | Typical owner |
10
+ |---|---|
11
+ | Stable identity resolution | Server or shared identity service |
12
+ | Assignment or Feature evaluation | Server |
13
+ | Typed default | Both sides, with one canonical value |
14
+ | Rendering or activation | Client |
15
+ | Exposure | Client when it knows rendering succeeded |
16
+ | Outcome events | Side that owns the business action |
17
+
18
+ These are design defaults, not fixed product requirements.
19
+
20
+ ## Server-to-client envelope
21
+
22
+ Define an application envelope such as:
23
+
24
+ ```text
25
+ {
26
+ featureKey,
27
+ value,
28
+ valueType,
29
+ assignmentOrGroupId,
30
+ configVersion,
31
+ evaluatedAt,
32
+ exposureToken?
33
+ }
34
+ ```
35
+
36
+ This is architecture-level pseudocode. Verify any AE-specific schema through `ae-cli`.
37
+
38
+ ## Consistency rules
39
+
40
+ - Server and client must use the same project, environment, Feature key, and stable identity.
41
+ - The client must validate the value type before applying it.
42
+ - A missing, invalid, or expired envelope falls back to the typed control behavior.
43
+ - Do not re-evaluate independently on the client after a server assignment unless the product explicitly supports that mode.
44
+ - Do not allow account switching to reuse another account’s cached envelope.
45
+ - Include a configuration version or equivalent diagnostic marker when the verified platform provides one.
46
+
47
+ ## Exposure handoff
48
+
49
+ The server should not report exposure merely because it returned a treatment envelope when the client may never render it. Prefer:
50
+
51
+ 1. server evaluates;
52
+ 2. client receives and validates;
53
+ 3. client applies behavior;
54
+ 4. client reports exposure once.
55
+
56
+ If exposure must be server-side, define a client acknowledgment or another verified activation signal and make retry idempotent.
57
+
58
+ ## Failure scenarios
59
+
60
+ - server evaluation succeeds, client render fails: no exposure;
61
+ - server times out: client uses control;
62
+ - client starts offline with cached assignment: use only within the documented stale window;
63
+ - server and client identity disagree: block rollout;
64
+ - both sides report exposure: disable one path before launch;
65
+ - value arrives after control rendered: freeze control for the session or use an explicitly approved transition.
66
+
67
+ ## Acceptance checks
68
+
69
+ - Server and client return or apply the same value type.
70
+ - Treatment is not visible before identity is stable.
71
+ - Exposure is reported by one owner.
72
+ - Refresh and retry do not duplicate exposure.
73
+ - Cached assignment is isolated by identity and environment.
74
+ - Outcome events remain joinable across client and server.