@thinkingai/ae-cli 6.1.32 → 6.1.33

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 (94) hide show
  1. package/README.md +6 -3
  2. package/README.zh.md +8 -3
  3. package/bin/runtime-capabilities.json +1 -1
  4. package/dist/{ai-monitor-MKMHSSNI.js → ai-monitor-OHTSU6SV.js} +10 -9
  5. package/dist/ai-monitor.js +14 -13
  6. package/dist/{auth-CZHHPZOQ.js → auth-2MOK4OI6.js} +18 -9
  7. package/dist/{automation-FLCPFMN4.js → automation-6L6IAYRK.js} +6 -7
  8. package/dist/{capability-64KVJFIA.js → capability-EMIHQJA3.js} +10 -9
  9. package/dist/{chunk-OAWPT7VP.js → chunk-2I5SZ5DS.js} +2 -2
  10. package/dist/{chunk-4XKTRCRK.js → chunk-4IQYPWCX.js} +9 -8
  11. package/dist/{chunk-T7WF4HYW.js → chunk-7DHSB3FL.js} +3 -3
  12. package/dist/{chunk-4PSTYEG5.js → chunk-AMURHMS3.js} +11 -7
  13. package/dist/{chunk-6M7ZEDT2.js → chunk-BQFLABJQ.js} +11 -7
  14. package/dist/{chunk-KTJXD27G.js → chunk-COOMXFUG.js} +3 -3
  15. package/dist/{chunk-NLEXY2TM.js → chunk-DWAG2QJM.js} +7 -5
  16. package/dist/{chunk-DWBYNGSR.js → chunk-E3ONSFUN.js} +165 -186
  17. package/dist/{chunk-CF6JTT2U.js → chunk-EFGUBGA6.js} +1 -1
  18. package/dist/{chunk-BNBCMCYN.js → chunk-EWVEAERM.js} +11 -11
  19. package/dist/{chunk-F2VFZUGG.js → chunk-HIMOBNEY.js} +2 -2
  20. package/dist/{chunk-JEUXDY3B.js → chunk-HQED4YB4.js} +1 -1
  21. package/dist/{chunk-2F64AZYH.js → chunk-KA5WKR5P.js} +2 -2
  22. package/dist/{chunk-FCAA7I2D.js → chunk-KD5UC33N.js} +23 -9
  23. package/dist/{chunk-P7QDCWJ6.js → chunk-LFJ7N36I.js} +5 -1
  24. package/dist/chunk-NNK3JBH4.js +60 -0
  25. package/dist/{chunk-3ULDJJTZ.js → chunk-O45NOIWR.js} +2 -2
  26. package/dist/{chunk-HTZ2MLYA.js → chunk-PLNS5J33.js} +11 -5
  27. package/dist/chunk-PUSFEC6B.js +29 -0
  28. package/dist/{chunk-Z3Q2AEIN.js → chunk-R2SVAO4G.js} +14 -2
  29. package/dist/{chunk-TMQGS4TO.js → chunk-RC3PPCYD.js} +3 -3
  30. package/dist/{chunk-HVMCPKOZ.js → chunk-THTROEGD.js} +1 -1
  31. package/dist/{chunk-QVRIDN42.js → chunk-UCMO4LKL.js} +2 -2
  32. package/dist/{chunk-5M5LBRR3.js → chunk-VLOGOM7N.js} +13 -7
  33. package/dist/{chunk-72NJKS7O.js → chunk-XZDKAR4N.js} +4 -4
  34. package/dist/{chunk-IDDWEZ7F.js → chunk-YE6MJB5V.js} +3 -3
  35. package/dist/{community-report-client-TJVCLZ3K.js → community-report-client-ULRNXLQV.js} +1 -1
  36. package/dist/{compat-check-ZJNCMNQV.js → compat-check-CADG7GND.js} +5 -4
  37. package/dist/{config-FSH2NMNZ.js → config-PFD3KWQG.js} +7 -6
  38. package/dist/{context-YAQG6YQC.js → context-SOQDFZIB.js} +8 -6
  39. package/dist/{data-integration-QE37EQ3A.js → data-integration-UNJ7EPW2.js} +6 -6
  40. package/dist/{evaluation-2JSF4V47.js → evaluation-Q3AIGFOG.js} +5 -5
  41. package/dist/index.js +47 -43
  42. package/dist/{local-data-upload-client-KCMG6J62.js → local-data-upload-client-YTWMAAGE.js} +1 -1
  43. package/dist/{memory-VEZZVAAP.js → memory-HKNGUIPK.js} +6 -7
  44. package/dist/{metadata-3IWHX3V4.js → metadata-GFWR5ZHC.js} +10 -9
  45. package/dist/{model-T7H7Q6BG.js → model-NAKQWK4W.js} +4 -5
  46. package/dist/{personal-semantic-preference-YITU23SA.js → personal-semantic-preference-JCTKXLC3.js} +45 -14
  47. package/dist/{project-semantic-MHEXJF3C.js → project-semantic-B2NWQOKK.js} +9 -8
  48. package/dist/{sync-AQHVCSPI.js → sync-UQH4J4BD.js} +9 -9
  49. package/dist/{te-agent-RXI7WOH4.js → te-agent-L6EYFQCC.js} +303 -17
  50. package/dist/{te-analysis-CZY74HVF.js → te-analysis-U7NNOY66.js} +25 -20
  51. package/dist/{te-community-DKCYUBCM.js → te-community-3UQEW3KD.js} +13 -11
  52. package/dist/{te-dataops-QEH6VE56.js → te-dataops-SUNYXF5G.js} +13 -11
  53. package/dist/{te-engage-WK7WKDKF.js → te-engage-KMXZJ2KN.js} +9 -8
  54. package/dist/{te-experiment-LH3RPIOE.js → te-experiment-IEYKP6VC.js} +215 -28
  55. package/dist/{te-kb-UPORIOVN.js → te-kb-MT3V5ZMH.js} +68 -17
  56. package/dist/{te-system-AL4B4XZL.js → te-system-F4ZU2HRQ.js} +6 -7
  57. package/dist/{te-team-LLVTO2G4.js → te-team-M6E6XQ5H.js} +9 -8
  58. package/dist/{things-XLMLBYQR.js → things-FRLBZV2Z.js} +9 -8
  59. package/dist/{update-7J5UQHSK.js → update-NULYHVE6.js} +8 -6
  60. package/dist/{workspace-FF2HXJGR.js → workspace-Z7L33OBQ.js} +6 -7
  61. package/package.json +6 -3
  62. package/skills/ae-agent/SKILL.md +19 -5
  63. package/skills/ae-agent/references/a2a.md +103 -0
  64. package/skills/ae-agent/references/command_index.md +11 -0
  65. package/skills/ae-analysis/SKILL.md +35 -23
  66. package/skills/ae-analysis/references/analysis_data_retrieval.md +1 -1
  67. package/skills/ae-analysis/references/asset_authentication_export.md +1 -1
  68. package/skills/ae-analysis/references/asset_authentication_update.md +6 -2
  69. package/skills/ae-analysis/references/bad_case_review.md +4 -4
  70. package/skills/ae-analysis/references/command_index.md +7 -7
  71. package/skills/ae-analysis/references/governance_recommendation_export.md +2 -2
  72. package/skills/ae-analysis/references/personal_semantic_preference_add.md +9 -1
  73. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +2 -0
  74. package/skills/ae-analysis/references/personal_semantic_preference_get.md +2 -0
  75. package/skills/ae-analysis/references/personal_semantic_preference_list.md +10 -2
  76. package/skills/ae-analysis/references/personal_semantic_preference_update.md +8 -0
  77. package/skills/ae-analysis/references/project_owner_update.md +5 -1
  78. package/skills/ae-analysis/references/scenario_evaluation.md +17 -1
  79. package/skills/ae-analysis/references/scenario_list.md +5 -6
  80. package/skills/ae-capability/SKILL.md +8 -4
  81. package/skills/ae-experiment/SKILL.md +45 -16
  82. package/skills/ae-experiment/references/experiment_approval.md +87 -29
  83. package/skills/ae-experiment/references/manage_experiment.md +7 -3
  84. package/skills/ae-experiment/references/manage_traffic_domains.md +131 -0
  85. package/skills/ae-experiment/references/query_experiment_detail.md +8 -0
  86. package/skills/ae-experiment/references/query_experiment_list.md +6 -0
  87. package/skills/ae-experiment/references/save_experiment.md +39 -13
  88. package/skills/ae-experiment/references/save_metric.md +29 -2
  89. package/skills/ae-experiment/references/save_submit_experiment.md +11 -7
  90. package/skills/ae-experiment/references/save_submit_external_experiment.md +16 -14
  91. package/skills/ae-experiment/references/save_traffic_layer.md +17 -1
  92. package/skills/ae-kb/SKILL.md +4 -2
  93. package/skills/ae-kb/references/publication.md +45 -0
  94. package/dist/chunk-Y74WTIKJ.js +0 -10
@@ -30,6 +30,31 @@ as in the backend. The Gateway does not expose optional approval/withdrawal rema
30
30
  `--approver` removes one existing open ID. Do not invent IDs or infer eligibility
31
31
  from membership in the Engage task approver list.
32
32
 
33
+ ## Current approval policy
34
+
35
+ These rules require the backend with the updated approval policy:
36
+
37
+ | Experiment / project roster | First submission and delivery changes |
38
+ | --- | --- |
39
+ | External experiment, any roster | Apply through the existing submission/save path without a new approval |
40
+ | Feature experiment, empty roster | Apply through the existing submission/save path without a new approval |
41
+ | Feature experiment, non-empty roster | Queue approval; keep effective configuration until approval |
42
+
43
+ A non-empty roster enables Feature approval even when all listed members have
44
+ lost eligibility. Only an empty roster disables it; a failed list request is
45
+ not an empty roster. Draft saves and display-only edits retain their existing
46
+ rules. Pause, resume, end, manual start, scheduling, and lifecycle validation
47
+ remain unchanged. Exempt Feature first submissions enter pending and use the
48
+ existing manual or future scheduled start; exemption does not grant the
49
+ approval-specific automatic startup or subscription continuation.
50
+
51
+ Deleting the last approver disables approval for subsequent submissions and
52
+ delivery changes. Adding an approver enables it without requiring retrospective
53
+ approval of effective configurations. Existing pending reviews and history are
54
+ preserved, including legacy external proposals. They are not applied automatically;
55
+ an authorized editor can withdraw and resubmit under the current policy. Do not
56
+ change the roster merely to work around an outstanding review.
57
+
33
58
  ## Server compatibility
34
59
 
35
60
  Before selecting approval commands for the active host, inspect metadata without
@@ -39,7 +64,11 @@ the project filter so project availability is not mistaken for an older server:
39
64
  ae-cli capability inspect experiment.approval.submit
40
65
  ```
41
66
 
42
- - Metadata returned: use the approval workflow below. For saved Feature drafts,
67
+ - Metadata returned: approval commands are available, but this alone does not
68
+ identify the policy version or enable approval for a project. Older
69
+ approval-capable servers may still review external experiments and empty-roster
70
+ submissions. Verify the deployed policy and read actual results. For saved
71
+ Feature drafts,
43
72
  either `approval submit` or the compatible `experiment experiment manage
44
73
  --target-status pending` submits once; do not execute both.
45
74
  - An explicit `CAPABILITY_NOT_FOUND`, or a verified deployed release without
@@ -56,12 +85,13 @@ ae-cli experiment experiment manage --project-id 1 --exp-id exp_123 --target-sta
56
85
  ae-cli experiment experiment get --project-id 1 --exp-id exp_123
57
86
  ```
58
87
 
59
- The same `manage` call still queues approval on approval-enabled servers; it
60
- cannot bypass approval. When approval support is known, read the proposal after
61
- this call instead of submitting again. External-experiment `save-submit` and
62
- L3 `experiment.experiment.save-submit` retain their existing calls: read approval
63
- on supported servers and runtime detail on older ones. New approval/settings
64
- operations themselves require a backend upgrade when their capability is absent.
88
+ The same `manage` call uses the server policy and cannot bypass required
89
+ approval. Read experiment detail after this call, and inspect any pending
90
+ proposal instead of submitting again. External-experiment `save-submit` and
91
+ L3 `experiment.experiment.save-submit` retain their existing calls and use the
92
+ same policy. Read runtime detail on every server and approval details when
93
+ supported and relevant. New approval/settings operations themselves require a
94
+ backend upgrade when their capability is absent.
65
95
  The CLI never automatically retries a failed approval write through `manage`
66
96
  or direct REST, including capability-not-found, permission, and stale-round errors.
67
97
 
@@ -74,16 +104,18 @@ or direct REST, including capability-not-found, permission, and stale-round erro
74
104
  ```bash
75
105
  ae-cli experiment approval submit --project-id 1 --exp-id exp_123 --dry-run
76
106
  ae-cli experiment approval submit --project-id 1 --exp-id exp_123
77
- ae-cli experiment approval get --project-id 1 --exp-id exp_123
107
+ ae-cli experiment experiment get --project-id 1 --exp-id exp_123
78
108
  ```
79
109
 
80
110
  The external-experiment `save-submit` command and L3
81
111
  `experiment.experiment.save-submit` already submit complete configuration;
82
- read approval afterward instead of submitting a second time.
83
- 3. Read `data.item.approval_id`, `state`, `configuration`, and available actions
84
- `can_approve`, `can_reject`, `can_cancel`. `item=null` means no approval history,
85
- not an approved experiment. Read `experiment experiment get` separately for
86
- the runtime status and current effective configuration.
112
+ read experiment detail afterward instead of submitting a second time.
113
+ 3. Check runtime `status`, effective configuration, and the `approval` summary.
114
+ For a pending review, read `experiment approval get --project-id 1 --exp-id exp_123`
115
+ and inspect `data.item.approval_id`, `state`, `configuration`, and available
116
+ actions `can_approve`, `can_reject`, `can_cancel`. `item=null` means no approval
117
+ history and is valid for exempt submissions. An older rejected or withdrawn
118
+ record can also remain after a direct submission; it is not a new pending review.
87
119
  4. Review the actual proposed configuration before approval. Apply only the
88
120
  user-requested action to that exact round. The commands never discover and
89
121
  substitute another approval ID automatically.
@@ -109,10 +141,11 @@ or that the real approval will succeed.
109
141
 
110
142
  ## State and configuration boundaries
111
143
 
112
- - First submission remains `status=draft` with `approval.state=pending_review`.
144
+ - When approval is required, first submission remains `status=draft` with
145
+ `approval.state=pending_review`.
113
146
  `mapping_status` is a display status; it does not replace the runtime `status`.
114
- - Submitted delivery changes queue an immutable proposal while the current
115
- configuration and runtime state continue to apply. This includes changes
147
+ - When approval is required, submitted delivery changes queue an immutable
148
+ proposal while the current configuration and runtime state continue to apply. This includes changes
116
149
  submitted through existing save commands; a successful boolean save is not
117
150
  proof that the new delivery configuration is effective.
118
151
  - Name, hypothesis, and other display-only changes normally save directly.
@@ -126,11 +159,10 @@ or that the real approval will succeed.
126
159
  It can start a due Feature experiment and synchronize Feature/RCC. A future
127
160
  start remains pending; audience subscription can also delay startup. A running
128
161
  or paused experiment keeps its lifecycle and original start time.
129
- - No configured eligible approver does not skip approval: submission stays
130
- pending until a valid approver is added and processes the existing round.
131
- Never add the caller as an approver just to bypass a pending review.
132
- - External experiments also use approval; after approval their time range
133
- determines pending/running/ended. They do not synchronize Feature/RCC.
162
+ - External experiments are exempt under the current policy. Their time range
163
+ determines pending/running/ended through the existing lifecycle; they do not
164
+ synchronize Feature/RCC. Existing pending external reviews still require
165
+ explicit withdrawal before resubmission.
134
166
 
135
167
  ## Approver settings and permissions
136
168
 
@@ -144,15 +176,41 @@ ae-cli experiment approver add --project-id 1 --approvers '["open_id_1","open_id
144
176
  ae-cli experiment approver delete --project-id 1 --approver open_id_1 --dry-run
145
177
  ```
146
178
 
147
- List before and after a requested settings change. Deletion keeps historical
148
- approval records and requires confirmation; non-interactive execution requires
149
- `--yes` after authorization. Ordinary writes do not prompt.
179
+ List before and after a requested settings change. Removing the last member
180
+ turns off subsequent Feature approval under the current policy, while
181
+ existing pending records remain pending. Deletion requires confirmation;
182
+ non-interactive execution requires `--yes` after authorization. Ordinary
183
+ writes do not prompt.
184
+
185
+ For an initial draft review that the user asks to withdraw and resubmit after
186
+ approval is disabled, first read and verify the pending round and `can_cancel`.
187
+ Withdrawal preserves the saved configuration. If the intended proposal differs
188
+ from that configuration, withdraw, rebuild and save the authorized changes, then
189
+ resubmit. When the saved configuration already matches the requested proposal,
190
+ for example for verified round `42`:
191
+
192
+ ```bash
193
+ ae-cli experiment approval withdraw --project-id 1 --exp-id exp_123 --approval-id 42
194
+ ae-cli experiment experiment manage --project-id 1 --exp-id exp_123 --target-status pending
195
+ ae-cli experiment experiment get --project-id 1 --exp-id exp_123
196
+ ```
197
+
198
+ For changes to an already submitted experiment, use its original save or save-submit
199
+ path after withdrawal; `approval submit` only submits saved drafts.
200
+
201
+ Each command requires the following CLI token scope and operator permissions:
202
+
203
+ | Command | CLI token scope | Operator permissions |
204
+ | --- | --- | --- |
205
+ | `experiment approver list` | `engage:read` | Experiment settings view (`experimentViewSetting`) |
206
+ | `experiment approver add/delete` | `engage:write` | Experiment settings edit (`experimentEditSetting`) |
207
+ | `experiment approval get` | `engage:read` | Experiment view (`experimentViewExperiment`) |
208
+ | `experiment approval submit/withdraw` | `engage:write` | Experiment edit (`experimentEditExperiment`) as the experiment creator, or experiment management (`experimentManageExperiment`) |
209
+ | `experiment approval approve/reject` | `engage:write` | Experiment view (`experimentViewExperiment`) and current experiment approver eligibility; experiment edit permission is not required |
150
210
 
151
- Reads require `engage:read` and experiment view permission. Writes require
152
- `engage:write`. Approve/reject additionally require current experiment approver
153
- eligibility, but do not require experiment edit permission. Submit/withdraw
154
- require the creator's experiment edit permission or experiment management
155
- permission; approver settings changes require experiment management permission.
211
+ Experiment settings permissions are independent of experiment view, edit, and
212
+ management permissions. Settings permissions do not grant approval eligibility;
213
+ approvers must belong to the project roster and retain experiment view permission.
156
214
  The server enforces permissions and project/resource ownership.
157
215
 
158
216
  ## Failures and older servers
@@ -20,9 +20,13 @@ It preserves the first start time and the existing day-based or fixed deadline.
20
20
  Do not run the standalone `ready-check` as a prerequisite for resuming a paused
21
21
  experiment; that command accepts only pre-launch states.
22
22
 
23
- On approval-enabled servers, `draft → pending` submits the saved draft for
24
- approval while its runtime status remains draft. This command also remains the
25
- submission path for older servers. Read
23
+ On updated servers, `draft → pending` submits the saved draft for approval
24
+ only for a Feature experiment with configured approvers; its runtime status
25
+ then remains draft. Exempt Feature submissions enter pending and retain the
26
+ existing manual or scheduled start. External experiments are exempt and use
27
+ their existing time-based state rules. Existing pending reviews still block
28
+ resubmission until withdrawn. This command also remains the submission path
29
+ for older servers. Read
26
30
  [server compatibility](experiment_approval.md#server-compatibility) before using
27
31
  dedicated approval commands; do not submit a second time or use `running` to
28
32
  bypass approval. Existing command flags and response shapes remain supported.
@@ -0,0 +1,131 @@
1
+ # Manage traffic domains
2
+
3
+ Use `ae-cli experiment traffic-domain list|create|update|delete` to manage root domains.
4
+ These commands use the engage Capability Gateway with CLI token authentication:
5
+ `experiment.traffic_domain.list|create|update|delete`. They require the matching Hermes
6
+ capabilities to be deployed; a local CLI upgrade alone does not add server support.
7
+
8
+ ## Discover and interpret the current state
9
+
10
+ ```bash
11
+ ae-cli experiment bucket list --project-id 1
12
+ ae-cli experiment traffic-domain list --project-id 1 --bucket-id '#account_id'
13
+ ```
14
+
15
+ Omit `--bucket-id` to list all configured subjects. Supported subjects are `#user_id`,
16
+ `#account_id`, `#distinct_id`, and `#device_id`. Each returned `data.items[]` is a Space:
17
+ `space_id` equals `bucket_id`, `allocation_version` is the quota concurrency token, and
18
+ `domains[]` contains `domain_id`, `domain_name`, `domain_desc`, `allocation_bps`,
19
+ `bucket_start`, `bucket_end`, `can_edit_metadata`, `can_adjust_allocation`,
20
+ `has_experiments`, and `can_delete`. `data.total` counts Spaces, not domains.
21
+ An empty list means there are no domains matching this query; it does not create a Space.
22
+
23
+ One Space is scoped to the project and bucket subject. Domains split its 10000 buckets
24
+ into mutually exclusive ranges. Layers within a domain split traffic independently.
25
+ Quotas are integers from 1 to 10000 basis points: 3000 means 30%, not 3000%.
26
+ Total quotas may be less than 10000; the remaining traffic is unallocated.
27
+ Domain basis points differ from the integer percentages used by experiment/group allocation.
28
+ Do not pass RCC publication versions as `--expected-version`.
29
+
30
+ ## Create and edit quotas
31
+
32
+ First domain for a subject (no existing Space):
33
+
34
+ ```bash
35
+ ae-cli experiment traffic-domain create --project-id 1 --bucket-id '#account_id' \
36
+ --name 'Checkout' --description 'Checkout experiments' \
37
+ --allocation-bps 3000 --expected-version 0 --dry-run
38
+ ```
39
+
40
+ Creating another domain requires **all existing domains** in `--allocations` and the
41
+ Space version returned by list. The following assumes list returned `d1` and version 1:
42
+
43
+ ```bash
44
+ ae-cli experiment traffic-domain create --project-id 1 --bucket-id '#account_id' \
45
+ --name 'Acquisition' --allocation-bps 2000 --expected-version 1 \
46
+ --allocations '[{"domain_id":"d1","allocation_bps":3000}]' --dry-run
47
+ ```
48
+
49
+ Metadata update requires the current or new name. Omitted `--description` clears the
50
+ saved description; pass the existing description to preserve it. No version is required
51
+ for metadata-only changes, and they do not increment the quota version.
52
+
53
+ ```bash
54
+ ae-cli experiment traffic-domain update --project-id 1 --domain-id d1 \
55
+ --name 'Checkout' --description 'Revised description' --dry-run
56
+ ```
57
+
58
+ For a quota update, supply `--allocation-bps`, `--expected-version`, and `--allocations`
59
+ together. The allocation array must contain every **other** domain of the same subject,
60
+ without duplicates or the domain being updated. Pass `[]` when there are no other domains.
61
+ For example, after list confirms version 2 and the two IDs:
62
+
63
+ ```bash
64
+ ae-cli experiment traffic-domain update --project-id 1 --domain-id d1 \
65
+ --name 'Checkout' --allocation-bps 4000 --expected-version 2 \
66
+ --allocations '[{"domain_id":"d2","allocation_bps":2000}]' --dry-run
67
+ ```
68
+
69
+ The subject is immutable. `--bucket-id` on update is optional and must match the saved
70
+ subject. The backend checks completeness, ownership, current experiment states and
71
+ contiguous bucket availability under its transaction locks. `testing`, `pending`,
72
+ `running`, `paused`, and unknown experiment states protect domain quota and bucket ranges.
73
+ Domains with only `draft`, `ended`, or `archive` experiments may be adjusted with permission.
74
+ An unchanged protected domain can remain in the complete allocation array while another
75
+ domain uses remaining capacity. A Space-level `can_adjust_allocation=false` does not
76
+ by itself prohibit creating a domain from unallocated traffic.
77
+
78
+ `--validate` and `--dry-run` are mutually exclusive, non-writing contract checks; they do
79
+ not reserve versions or guarantee that execution will pass current business checks.
80
+ After review, execute by omitting `--dry-run`. After a successful quota write, list again.
81
+ On `TRAFFIC_DOMAIN_VERSION_CONFLICT`, re-list, compare the changed quotas with the user's
82
+ intent, and rebuild the request. Do not silently replace the version or retry the write.
83
+ For locked quotas, permission failures or fragmented capacity, report the reason without
84
+ changing experiment states or other domains automatically.
85
+
86
+ ## Bind layers and exclusive experiment drafts
87
+
88
+ Use existing `traffic-layer save --req` and `experiment save --req` commands. Their nested
89
+ DTO fields remain camelCase; use `domainId`, not `domain_id`, inside `--req`.
90
+
91
+ ```bash
92
+ ae-cli experiment traffic-layer save --project-id 1 \
93
+ --req '{"layerName":"Checkout layer","layerType":"remote","bucketId":"#account_id","domainId":"d1"}' --dry-run
94
+ ae-cli experiment traffic-layer save --project-id 1 \
95
+ --req '{"layerId":"layer1","domainId":"d1"}' --dry-run
96
+ ae-cli experiment experiment save --project-id 1 \
97
+ --req '{"expName":"Checkout draft","isExpSharing":0,"bucketId":"#account_id","layerType":"remote","domainId":"d1"}' --dry-run
98
+ ```
99
+
100
+ Domain and resource must belong to the same project and bucket subject. Layer-only
101
+ patches can bind or clear (`domainId:""`) membership when all related experiments are
102
+ `draft`, `ended`, or `archive`; omitted/null `domainId` retains existing membership.
103
+ Changing a layer's domain preserves its ID and salt. Exclusive experiment drafts may
104
+ select/change/clear their domain; shared experiments use their selected layer's domain
105
+ and ignore the exclusive `domainId` input. Changing an exclusive draft's domain may
106
+ recreate its private layer while preserving experiment ID, salt and group identities.
107
+ Layer and experiment list/get results expose nullable `domain_id` and `domain_name`;
108
+ historical unbound layers remain unbound. Legacy CLI layer creation without `domainId`
109
+ remains supported. Prefer explicit domain selection for new domain-based traffic.
110
+ Remote routing applies domain isolation after the Hermes/RCC upgrade; complete SDK local
111
+ Space/Domain evaluation is a later stage. Do not promise local domain isolation from
112
+ `layerType:"local"` alone.
113
+
114
+ ## Delete a domain
115
+
116
+ Read current state, verify `can_delete`, and confirm the target domain with the user.
117
+ Preview using the latest Space version:
118
+
119
+ ```bash
120
+ ae-cli experiment traffic-domain delete --project-id 1 --domain-id d1 \
121
+ --expected-version 3 --dry-run
122
+ ```
123
+
124
+ Only after user confirmation, remove `--dry-run` and add `--yes` for non-interactive use.
125
+ Deletion is `high-risk-write`. It soft-deletes the domain and unbinds every linked layer,
126
+ including historical layers, while retaining layers and experiments, layer IDs, salts,
127
+ and subjects. It requires resource permission on the domain and all linked layers;
128
+ active or unknown experiment states block deletion. Released quota becomes unallocated;
129
+ other domains' quotas and ranges remain unchanged, and their quota version increments.
130
+ Deleting the final domain returns `data.items: []`. Creation after the final deletion
131
+ uses version 0 from the now-empty quota API state, not an RCC publication revision.
@@ -11,6 +11,14 @@ Flags:
11
11
  - `--exp-id`: Experiment ID.
12
12
 
13
13
  Response shape: the experiment is in `data.item`, with recursively snake_case keys such as `exp_id` and `feature_key_list`.
14
+ The effective traffic-layer routing mode is returned as `data.item.layer_type`
15
+ (`remote` or `local`).
16
+
17
+ On approval-capable servers, `status` remains the runtime state;
18
+ `mapping_status` is for display and `approval` describes the latest review.
19
+ An absent or null approval is valid for exempt experiments. Historical
20
+ rejected/withdrawn records can remain after a direct submission; read the
21
+ actual configuration and status rather than treating history as a new review.
14
22
 
15
23
  Feature timing is exposed as `start_time`, `end_time`, and `exp_cycle` (including
16
24
  `cycle_type`, `fixed_end_time`, and planned `end_time`). The top-level `end_time`
@@ -17,6 +17,12 @@ Flags:
17
17
 
18
18
  Response shape: `data.items` contains the experiments, `data.total` contains the count, and item keys are recursively snake_case.
19
19
 
20
+ On approval-capable servers, `status` remains the runtime state;
21
+ `mapping_status` is for display and `approval` describes the latest review.
22
+ An absent or null approval is valid for exempt experiments. Historical
23
+ rejected/withdrawn records can remain after a direct submission; read the
24
+ actual configuration and status rather than treating history as a new review.
25
+
20
26
  Targeting follows the same semantic projection as detail:
21
27
  `targeting.definition_request` plus `targeting.definition_status`; internal
22
28
  `target_config` is not returned.
@@ -27,12 +27,15 @@ Flags:
27
27
 
28
28
  Response shape is `data.result`. Object keys inside the result are recursively snake_case. A create commonly returns the new experiment ID as `data.result`; a patch commonly returns `true`.
29
29
 
30
- On approval-enabled servers, drafts save directly, while actual delivery changes
31
- to already submitted experiments queue approval without changing effective
32
- configuration. Display-only changes save directly unless a review is pending.
33
- Read [experiment approval](experiment_approval.md) and check `approval get` after
34
- updating a submitted experiment; `result=true` alone does not prove the new
35
- configuration is effective.
30
+ On updated servers, drafts save directly. Actual delivery changes to submitted
31
+ Feature experiments queue approval only when the project approver roster is
32
+ non-empty; effective configuration remains unchanged until approval. External
33
+ experiments and Feature experiments with an empty roster save directly.
34
+ Display-only changes save directly unless a review is pending. Existing
35
+ pending reviews still block editing after approval is disabled. Read
36
+ [experiment approval](experiment_approval.md), verify experiment detail after
37
+ saving, and inspect any pending review; `result=true` alone does not prove
38
+ the new configuration is effective.
36
39
 
37
40
  ## Payload Type Contract
38
41
 
@@ -41,6 +44,7 @@ Nested payload fields must match the server DTO types, not just the visible CLI
41
44
  | Field | Correct shape | Incorrect shape |
42
45
  | --- | --- | --- |
43
46
  | `featureKeyList` | `["payment_color"]` | `[{"featureKey":"payment_color"}]` |
47
+ | `layerType` | `"remote"` or `"local"` with `isExpSharing=0` | any other value, or missing/nonzero `isExpSharing` |
44
48
  | `allocation` | integer (e.g. `20`) | `20.5`, `33.33` |
45
49
  | `groups[].allocation` | integer; all groups sum to `100` (e.g. `34+33+33`) | `33.33`, or sum `99`/`101` |
46
50
  | `groups[].expGroupValue` | `"[\"green\"]"` | `["green"]` |
@@ -66,6 +70,7 @@ Optional while drafting:
66
70
  - `expType` (blank defaults to `feature`)
67
71
  - `groupId`
68
72
  - `trafficLayerId`
73
+ - `layerType`
69
74
  - `allocation`
70
75
  - `expSalt`
71
76
  - `expSupposition`
@@ -107,8 +112,9 @@ ae-cli experiment experiment save --project-id 1 --req '{"expId":"exp_123","allo
107
112
 
108
113
  ## Field Notes
109
114
 
110
- - `isExpSharing=1` uses a shared traffic layer from `experiment traffic-layer list`; pick a `trafficLayerId` whose available idle traffic can cover `allocation`.
111
- - `isExpSharing=0` uses exclusive traffic with `bucketId`; select the bucket with `experiment bucket list`.
115
+ - `isExpSharing=1` uses a shared traffic layer from `experiment traffic-layer list`; pick a `trafficLayerId` whose available idle traffic can cover `allocation`. Do not pass `layerType` because the selected layer already defines its routing mode.
116
+ - `isExpSharing=0` uses exclusive traffic with `bucketId`; select the bucket with `experiment bucket list`. Set `layerType` to `remote` or `local`; omitted mode defaults to `remote`.
117
+ - Local routing (`layerType="local"`) does not support `bucketId="#user_id"`. Use another bucket returned by `experiment bucket list`, such as `#account_id` or `#distinct_id` when available.
112
118
  - `allocation` (experiment-level) is the experiment's share of the traffic layer. It is optional during draft construction, but before readiness it must be greater than `0` and no more than `100`. **Integer only** (for example `20`); decimals such as `20.5` are rejected at the CLI interface.
113
119
  - `groups[].allocation` (group-level): **integer only; sum must equal `100` exactly**. Example for 3 groups: `34 + 33 + 33 = 100`. Decimals such as `33.33` are rejected at the CLI interface before save.
114
120
  - `expCycle.cycleType` can be `day`, `sample`, or `time`; when `cycleType=day`, `dayNum` is `1..90`. `time` requires `fixedEndTime`. Blank cycle defaults to day + 30.
@@ -186,16 +192,20 @@ This submission path works on older and approval-enabled servers. Before using
186
192
  the dedicated `approval submit` alternative or reading/processing approvals,
187
193
  follow [server compatibility](experiment_approval.md#server-compatibility).
188
194
  Submit once; do not call `approval submit` after `manage` has already submitted.
189
- On approval-enabled servers, also read `experiment approval get`; submission
190
- keeps runtime `status=draft` with `approval.state=pending_review`.
195
+ On updated servers, a Feature experiment with a non-empty approver roster
196
+ keeps runtime `status=draft` with `approval.state=pending_review`; read
197
+ `experiment approval get` for that proposal.
191
198
  An authorized approver must review and approve the exact proposal. Approval can
192
199
  start a due Feature experiment immediately; future starts stay pending, and
193
200
  audience subscription may delay startup. Approved experiments waiting for
194
201
  subscription can resume automatically after readiness is restored. Scheduled
195
202
  experiments are checked every half hour. A draft never starts automatically.
196
- Older servers without approval capabilities retain their existing submission
197
- behavior; verify their runtime detail instead of calling approval endpoints.
198
- On those servers, a pending Feature without a start time requires manual start.
203
+ With an empty roster on an updated server, Feature submission enters pending
204
+ without creating an approval. A future start follows the existing schedule;
205
+ a missing or already elapsed start time requires manual start. Exemption
206
+ does not invoke the approval-specific automatic startup or subscription
207
+ continuation. Older servers retain their deployed policy; verify runtime
208
+ detail and call approval endpoints only when supported.
199
209
  Verify `data.item.status`, `start_time`, and
200
210
  `scheduled_start_error` with `get` (or `list`). An expired pending window remains
201
211
  pending and reports an error; fix the timing instead of reporting a start.
@@ -219,6 +229,14 @@ Timing changes follow server lifecycle rules:
219
229
 
220
230
  ## Payload Examples
221
231
 
232
+ Create an exclusive local-routing draft:
233
+
234
+ ```bash
235
+ ae-cli experiment experiment save --project-id 1 --req '{"expName":"Local routing draft","isExpSharing":0,"layerType":"local","bucketId":"#account_id"}'
236
+ ```
237
+
238
+ After creation, `experiment experiment get` returns the effective mode as `data.item.layer_type`.
239
+
222
240
  Patch a Feature binding. `featureKeyList` is a string array:
223
241
 
224
242
  ```bash
@@ -302,3 +320,11 @@ Use readiness failures to decide the next patch. For submitted experiments,
302
320
  read approval and effective experiment detail instead of applying a pre-launch
303
321
  readiness check to a running or paused experiment. Report a queued change as
304
322
  awaiting approval until the stored proposal is approved and its effect verified.
323
+
324
+ ## Exclusive traffic domain
325
+
326
+ `req.domainId` selects a root domain for an exclusive draft (`isExpSharing=0`). The domain
327
+ must match the project and bucket subject. Omitted/null domain retains existing membership;
328
+ an empty string clears it on a draft. Shared experiments use their traffic layer's domain.
329
+ List/get return nullable `domain_id` and `domain_name`. Read
330
+ [`manage_traffic_domains.md`](manage_traffic_domains.md) before binding or changing domains.
@@ -12,6 +12,13 @@ Flags:
12
12
 
13
13
  Create mode requires metric identifiers and metric configuration. Modify mode uses `update=true`.
14
14
 
15
+ For event metrics using `user_count`, `total_count`, or `active_days`, the
16
+ dedicated CLI save and `save validate --operation-mode save_metric` commands
17
+ default omitted create fields to `metricPurpose: "confidence_statistics"` and
18
+ `format: "integer"`. Explicit values take precedence. For updates, omitted
19
+ fields are left out of the request. Send both fields explicitly when calling
20
+ the gateway directly or using an older CLI.
21
+
15
22
  Do not paste `save build-guide` / `save validate` `example_args.req` keys (`metric_id`, …) into
16
23
  `--req`. Those responses snake_case nested placeholders; final save requires camelCase.
17
24
  See [`save_build_guide.md`](save_build_guide.md) / [`save_validate.md`](save_validate.md).
@@ -19,8 +26,10 @@ See [`save_build_guide.md`](save_build_guide.md) / [`save_validate.md`](save_val
19
26
  ## Semantic Metric Contract
20
27
 
21
28
  - Supply metric QP as `req.metricDefinition`.
29
+ - To set a display format, pass `req.format` alongside `req.metricDefinition`. Use `integer` for counts, `float2` for two decimal places, or `percent` for rates. Provide it explicitly when creating metrics outside the defaults above. When updating, omit it to keep the saved format.
22
30
  - Never submit internal `metricConfig`, `calcType`, or an `Axxx` calculation code.
23
- - Experiment metrics currently accept event definitions only.
31
+ - Set `metricDefinition.type` to `event`, `formula`, `retention`, or `funnel` as supported by the target server's `experiment.metric.save` schema. Formula uses `createType: "event"`. Event definitions accept optional `display_name`.
32
+ - On updates, read the existing metric first and keep its saved `createType`. Event and formula share the event type. To switch between event, retention, and funnel, create a separate metric.
24
33
  - Event-property comparisons belong in `metricDefinition.filters`. Each item uses
25
34
  `field`, `operator`, and `values`; do not place `operator` or `value` directly on
26
35
  `metricDefinition`.
@@ -42,10 +51,20 @@ When `aggregation` is `sum`, `avg`, `max`, or `distinct_count`:
42
51
 
43
52
  When `aggregation` is `total_count`, `user_count`, or `active_days`, omit `property`.
44
53
 
54
+ ### Formula, retention, and funnel definitions
55
+
56
+ Inspect `input_schema.properties.req.properties.metricDefinition` on the target server for the full schema. Use camelCase for the fields of `req` and keep the schema's field names inside `metricDefinition`.
57
+
58
+ | Definition type | Key fields |
59
+ | --- | --- |
60
+ | `formula` | `expression` uses the bare keys of its event `dependencies`. Each dependency needs a unique `key`. |
61
+ | `retention` | Set `analysis_subject`, `initial_event`, `return_event`, `time_granularity`, `retention_type`, and `display_mode`. Use `metricPurpose: "observation"` for retention count, churn count, and simultaneous display. |
62
+ | `funnel` | Set `analysis_subject`, at least two ordered `steps`, `relation_property`, and a `window` with `value` and `unit`. |
63
+
45
64
  ### Preset event metric example (no property)
46
65
 
47
66
  ```bash
48
- ae-cli experiment metric save --project-id 1 --req '{"metricId":"payment_users","metricName":"Payment users","createType":"event","goalDirection":"up","metricDesc":"Users who triggered payment","metricDefinition":{"type":"event","event":"payment","aggregation":"user_count"}}'
67
+ ae-cli experiment metric save --project-id 1 --req '{"metricId":"payment_users","metricName":"Payment users","createType":"event","goalDirection":"up","metricPurpose":"confidence_statistics","metricDesc":"Users who triggered payment","format":"integer","metricDefinition":{"type":"event","event":"payment","aggregation":"user_count"}}'
49
68
  ```
50
69
 
51
70
  ### Correct example (avg with property)
@@ -56,7 +75,9 @@ ae-cli experiment metric save --project-id 1 --req '{
56
75
  "metricName":"Startup style payment avg",
57
76
  "createType":"event",
58
77
  "goalDirection":"up",
78
+ "metricPurpose":"confidence_statistics",
59
79
  "metricDesc":"Average payment amount",
80
+ "format":"float2",
60
81
  "metricDefinition":{
61
82
  "type":"event",
62
83
  "event":"payment",
@@ -70,6 +91,12 @@ ae-cli experiment metric save --project-id 1 --req '{
70
91
  }'
71
92
  ```
72
93
 
94
+ ### Change the display format only
95
+
96
+ ```bash
97
+ ae-cli experiment metric save --project-id 1 --req '{"metricId":"payment_users","update":true,"format":"integer"}'
98
+ ```
99
+
73
100
  ### Wrong example (avg without property — rejected)
74
101
 
75
102
  ```json
@@ -17,11 +17,14 @@ Prefer `experiment experiment save` for progressive draft construction.
17
17
 
18
18
  Feature requests may include optional `req.startTime` and
19
19
  `req.expCycle={"cycleType":"time","fixedEndTime":"2026-11-08T16:00:00+08:00"}`.
20
- Use ISO-8601 timestamps with timezone offsets. On approval-enabled servers,
21
- initial submission and actual delivery changes create a pending approval;
20
+ Use ISO-8601 timestamps with timezone offsets. On updated servers, only
21
+ Feature experiments with a non-empty approver roster create a pending approval
22
+ for initial submission or actual delivery changes. An empty roster submits
23
+ directly; exempt Feature drafts enter pending for the existing manual or
24
+ scheduled start. Verify experiment detail after submitting, and
22
25
  read [server compatibility](experiment_approval.md#server-compatibility) before
23
- using `experiment approval get`. On older servers, retain this save-submit call
24
- and verify runtime detail without calling approval endpoints.
26
+ using `experiment approval get`. On servers without approval support, retain
27
+ this save-submit call and verify runtime detail without calling approval endpoints.
25
28
  Do not submit the same saved draft again after this call. Approval can start a
26
29
  due Feature experiment; a future start waits for the server's half-hour checks.
27
30
  See [Feature timing](save_experiment.md#feature-timing) for
@@ -29,9 +32,10 @@ the draft, submission, manual-start, and deadline boundaries.
29
32
 
30
33
  For external experiments on servers exposing `req.clearEndTime`, omitted or null
31
34
  `req.endTime` preserves a saved deadline. Cancel it with `req.clearEndTime=true`
32
- and no non-null `req.endTime`; this remains subject to approval for submitted
33
- experiments. Copy an existing `req.startTime` exactly when retaining it; the
34
- backend preserves that saved instant through review and application, including
35
+ and no non-null `req.endTime`. Updated servers apply external experiment
36
+ changes without approval; any existing pending review must first be withdrawn.
37
+ Copy an existing `req.startTime` exactly when retaining it; the backend
38
+ preserves that saved instant when applying the change, including
35
39
  seconds and milliseconds from manual activation. Other than adding this optional field, the native request is
36
40
  unchanged. See [external deadline compatibility](save_submit_external_experiment.md#deadline-updates-and-server-compatibility)
37
41
  before calling an older server. Never silently translate an unsupported clear
@@ -27,12 +27,14 @@ Choose an existing `bucket_id` whose property is available in the events used by
27
27
  bound metric. The server requires at least two named groups, exactly one control group,
28
28
  and at least one existing primary metric.
29
29
 
30
- On approval-enabled servers, first submission and actual delivery changes enter
31
- approval. Follow [server compatibility](experiment_approval.md#server-compatibility)
32
- before reading `experiment approval get` after saving. On older servers, retain
33
- this save-submit call and verify runtime detail without calling approval endpoints.
34
- A successful submit is not evidence
35
- that the experiment is running; do not submit it again with `approval submit`.
30
+ On updated servers, external experiments submit and save delivery changes
31
+ without approval, regardless of the project approver roster. Existing pending
32
+ reviews from older policies remain pending and must be withdrawn before
33
+ resubmission. Follow [server compatibility](experiment_approval.md#server-compatibility):
34
+ older approval-capable servers may still queue review. Read experiment detail
35
+ after saving, and inspect a pending review only when supported. A successful
36
+ submit is not evidence that the experiment is running; do not submit it again
37
+ with `approval submit`.
36
38
 
37
39
  Once submitted configuration is effective, status is calculated from its time range: a future start time becomes
38
40
  `pending`, a current range becomes `running`, and an elapsed end time becomes `ended`.
@@ -66,18 +68,17 @@ On servers exposing `req.clearEndTime`:
66
68
  Native `req.endTime=null` also preserves it; neither expresses cancellation.
67
69
  - Use `--clear-end-time true` with `--exp-id` to cancel a saved deadline. Do not
68
70
  combine it with `--end-time`. `--clear-end-time false` sends no clear field.
69
- - On approval-enabled servers, cancelling a submitted experiment's deadline
70
- queues approval. The effective deadline remains until approval; rejection or
71
- withdrawal keeps it, and the historical proposal remains unchanged.
71
+ - Under the current approval policy, cancelling an external experiment's
72
+ deadline applies directly. Existing pending reviews must first be withdrawn;
73
+ disabling approval does not apply their proposed deadline automatically.
72
74
 
73
75
  For an existing experiment, reuse its verified name, bucket, start, complete
74
76
  groups and metric bindings when constructing the cancellation request:
75
77
 
76
78
  Copy the saved start timestamp verbatim, including seconds and milliseconds;
77
79
  do not round it in the client. The matching backend preserves an unchanged saved
78
- start through submission and approval. Only new or actually changed start times
79
- round up to a half-hour boundary. An unchanged update must not create an approval
80
- merely because a manually recorded start is not aligned to that boundary.
80
+ start through submission. Only new or actually changed start times round up
81
+ to a half-hour boundary; retaining a manually recorded start preserves its precision.
81
82
 
82
83
  ```bash
83
84
  ae-cli experiment external-experiment save-submit \
@@ -88,8 +89,9 @@ ae-cli experiment external-experiment save-submit \
88
89
  --clear-end-time true --dry-run
89
90
  ```
90
91
 
91
- After submitting the selected change, read both approval and experiment detail;
92
- do not report the deadline as cancelled while the proposal is pending.
92
+ After submitting the selected change, read experiment detail and verify the
93
+ saved deadline. If an older server queues approval, read the pending proposal
94
+ and do not report the deadline as cancelled before its effect is verified.
93
95
 
94
96
  Older servers without this field may still clear a deadline when `endTime` is
95
97
  omitted or null. Pass the saved `--end-time` to retain it across server versions.