@thinkingai/ae-cli 6.0.39 → 6.0.40

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.
@@ -23,7 +23,18 @@ Use this sequence when creating or updating a task draft:
23
23
  Build event primitives from `ae-analysis` user-cluster / audience models. Hermes wraps those
24
24
  primitives in the task-specific envelope selected by `channelType`, `triggerType`, and
25
25
  `eventTriggerType`, then validates the final persisted QP before save. Never construct persisted
26
- execution QP.
26
+ execution QP. Follow the documented closed semantic shapes: unknown fields are rejected, and a
27
+ property `field` may be a technical-name string or a `{name,type}` reference.
28
+ Every custom-audience `event` and `behavior_sequence` requires its own `time_range`. For
29
+ `recent` and `previous`, use a positive integer `value` and only `unit=day`; `custom` requires
30
+ both `start_time` and `end_time`.
31
+
32
+ Custom audiences support `behavior_sequence` nodes, including sequence/step windows, step
33
+ filters, `completed`, and `relative_to_first`. A task `get` may return top-level `compound`
34
+ nodes when the stored member-group, event-group, and outer relations differ. Preserve those
35
+ compounds when reusing `definition_request`; flattening them changes audience semantics.
36
+ For the second sequence step, omit `relative_to_first` or set it to `false`; use `true` only
37
+ from the third step onward when its window must be measured from step 1.
27
38
 
28
39
  For existing-cluster audiences (`targetClusterType=2`), you may copy server-authored definitions via:
29
40
 
@@ -266,6 +277,19 @@ The guide treats the A rule as a discriminated envelope:
266
277
  Do not copy the accumulated example and only change `eventTriggerType`. Hermes rejects a final QP
267
278
  whose event structure does not match its envelope.
268
279
 
280
+ #### `fieldRules.blocks.controlConfig.completionIndicatorDef.filterPropertySelectTypes`
281
+
282
+ Treat this as the source of truth for completion target and experiment main-goal event-filter
283
+ property types:
284
+
285
+ - `allowed` lists the supported metadata `select_type` values.
286
+ - `excluded` lists values that must not be used.
287
+ - `datetime` is excluded because the task completion-indicator editor cannot display it.
288
+
289
+ Apply this rule only to
290
+ `completionIndicatorDef.completionIndicators[].eventDefinition.filters`. Trigger-event filters have
291
+ their own scenario rules and are not subject to this completion-filter restriction.
292
+
269
293
  ### 4.9 `handoff`
270
294
 
271
295
  This is the final section before `save_task`.
@@ -3,6 +3,13 @@
3
3
  > Trigger keywords: common metric, shared metric · Capability ids: `engage-setting.common-metric.{list,get,create,update,delete}` · Permission: `opsEditSetting`.
4
4
 
5
5
  Common metric capabilities expose semantic event/formula definitions. Do not submit or reuse `metric_qp`, `Axxx`, display metadata, formula dependency internals, or property metadata.
6
+ Metric definitions and formula dependencies reject unknown fields. Event filter `field` accepts
7
+ either a technical-name string or `{"name":"...","type":"event_property"}`.
8
+
9
+ When metadata reports an event property as `array_row`, express it as an `object_group` filter
10
+ with `any_satisfy`, `none_satisfy`, or `all_satisfy`; its nested `conditions.items` may reference
11
+ only child properties of that parent. Flat filters on the `array_row` parent are rejected before
12
+ the metric is saved.
6
13
 
7
14
  ## Commands
8
15
 
@@ -39,8 +46,41 @@ ae-cli engage-setting common-metric delete --project-id <project_id> --metric-na
39
46
  }
40
47
  ```
41
48
 
49
+ Object-group filter example:
50
+
51
+ ```json
52
+ {
53
+ "type": "object_group",
54
+ "field": "equipment_list",
55
+ "operator": "any_satisfy",
56
+ "conditions": {
57
+ "relation": "and",
58
+ "items": [
59
+ {
60
+ "field": "equipment_list.item_level",
61
+ "operator": "gte",
62
+ "values": [10]
63
+ }
64
+ ]
65
+ }
66
+ }
67
+ ```
68
+
42
69
  Supported aggregations include `total_count`, `user_count`, `per_user_count`, `sum`, `avg`, `avg_per_user`, `max`, `min`, `distinct_count`, `median`, `percentile`, `variance`, and `stddev`.
43
70
 
71
+ Property aggregations require `property`. `percentile` additionally requires a numeric
72
+ `percentile` greater than `0` and at most `100`:
73
+
74
+ ```json
75
+ {
76
+ "type": "event",
77
+ "event": "purchase",
78
+ "aggregation": "percentile",
79
+ "property": "amount",
80
+ "percentile": 90
81
+ }
82
+ ```
83
+
44
84
  ## Formula metric
45
85
 
46
86
  ```json
@@ -65,6 +105,11 @@ Supported aggregations include `total_count`, `user_count`, `per_user_count`, `s
65
105
  }
66
106
  ```
67
107
 
108
+ Every dependency requires a non-empty, unique `key`, and every key must be used in
109
+ `expression`. Write bare keys only: use `purchases/refunds`, never `purchases.A100/refunds.A100`.
110
+ Aggregation codes are derived from each dependency. Formula dependencies follow the same
111
+ property and percentile requirements as event metrics.
112
+
68
113
  Resolve every event and property through `ae-cli analysis-meta event list` and the corresponding property metadata before writing. `get` and `list` return `metric_definition`, `metric_definition_status`, and an optional unavailable reason. Raw metric QP is hidden.
69
114
 
70
115
  `metric_type=1` remains required for setting-page common metrics. Metric windows remain separate from the semantic definition, and their unit must be `minute` / `hour` / `day`.
@@ -12,6 +12,8 @@ ae-cli engage-setting preset-event update --project-id <project_id> \
12
12
  ```
13
13
 
14
14
  At least one definition is required for update. Event filters use semantic `field`, `operator`, `values`, and `and`/`or`; Hermes resolves project metadata and compiles the stored event object.
15
+ `field` accepts a technical-name string or `{"name":"...","type":"event_property"}`. Unknown
16
+ semantic fields, unsupported relations/operators, and invalid time ranges are rejected.
15
17
 
16
18
  List hides the stored event QP and returns each semantic field plus its conversion status:
17
19
 
@@ -177,6 +177,14 @@ ae-cli analysis user-cluster get --project-id <projectId> --cluster-names '["<co
177
177
  ```
178
178
 
179
179
  Prefer the created cluster reference for an existing-cluster audience. For a custom audience, pass the semantic definition as `targetDefinitionRequest`; do not copy or construct stored execution QP.
180
+ Use only the documented semantic fields. Unknown fields are rejected, and property `field` values
181
+ may be technical-name strings or `{name,type}` references.
182
+
183
+ Custom flow audiences support `behavior_sequence`. When `flow get` returns relation-preserving
184
+ top-level `compound` nodes, retain them unchanged in subsequent saves; they preserve distinct
185
+ member-group, event-group, and outer relations.
186
+ For the second sequence step, omit `relative_to_first` or set it to `false`; use `true` only
187
+ from the third step onward when its window must be measured from step 1.
180
188
 
181
189
  ### 5.2 Project Channels
182
190
 
@@ -239,6 +247,12 @@ Inside action nodes: `channel_name` → real `channelId`; `content` → `content
239
247
  3. Every path must eventually end at `exit_flow`.
240
248
  4. `config` may be a JSON object or a JSON string. `targetDefinitionRequest` itself is a JSON object.
241
249
  5. Hermes compiles `targetDefinitionRequest` and Flow-specific `triggerDefinition` fields (including branch definitions) on `nodes[]`, `nodeConfigs[]`, and `slotAnswer.nodeConfig.config` before legacy node validation. `node-config validate` uses the same compile path. Other compatible input normalization remains unchanged.
250
+ 6. Never send `targetClusterQp`; it is a server-authored execution field. Every `event` and
251
+ `behavior_sequence` inside `targetDefinitionRequest` must include its own `time_range`.
252
+ Entry-node `startDate` / `endDate` values do not provide an audience-event time range.
253
+ 7. Audience fields must resolve through the current Flow editor metadata scope. If Hermes
254
+ rejects a field, choose another property returned for the same project, timezone, and user
255
+ entity instead of constructing persisted metadata manually.
242
256
 
243
257
  ### 7.2 Common Node Types
244
258
 
@@ -120,6 +120,39 @@ Task aggregate and completion event definitions support:
120
120
  - `aggregation`: `count`, `sum`, or `distinct_count`
121
121
  - `operator`: `gt`, `gte`, or `eq`
122
122
 
123
+ Completion target and experiment main-goal event filters must not use properties whose metadata
124
+ `select_type` is `datetime`. The supported filter-property select types are `string`, `number`,
125
+ `bool`, `bool-s`, `date`, `array`, `array_string`, `row`, and `array_row`. This restriction applies
126
+ to `completionIndicatorDef.completionIndicators[].eventDefinition.filters`; it does not apply to
127
+ trigger-event filters.
128
+
129
+ For an event property whose metadata `select_type` is `array_row`, never submit it as a flat
130
+ property filter. Use an object-group filter and place only that parent's child properties inside
131
+ `conditions`:
132
+
133
+ ```json
134
+ {
135
+ "type": "object_group",
136
+ "field": "equipment_list",
137
+ "operator": "any_satisfy",
138
+ "conditions": {
139
+ "relation": "and",
140
+ "items": [
141
+ {
142
+ "field": "equipment_list.item_level",
143
+ "operator": "gte",
144
+ "values": [10]
145
+ }
146
+ ]
147
+ }
148
+ }
149
+ ```
150
+
151
+ Object-group operators are `any_satisfy`, `none_satisfy`, and `all_satisfy`. Resolve the parent
152
+ and child fields from current metadata. Hermes validates the metadata type, child-parent
153
+ relationship, and supported operators before saving, so do not flatten `array_row` or invent child
154
+ field names.
155
+
123
156
  Trigger events have an additional envelope contract selected by `eventTriggerType`. Do not apply
124
157
  one aggregate event shape to every trigger type. Use the matrix and examples in section 4.4.
125
158
 
@@ -381,6 +414,8 @@ Minimum required field:
381
414
 
382
415
  When the guide points to event-based completion or experiment-driven main-goal rules, build
383
416
  `completionIndicatorDef.completionIndicators[].eventDefinition` from the semantic event contract.
417
+ Read `fieldRules.blocks.controlConfig.completionIndicatorDef.filterPropertySelectTypes` and exclude
418
+ every property type listed under `excluded` before constructing its `filters`.
384
419
 
385
420
  Important constraints that still apply:
386
421
 
@@ -25,19 +25,19 @@ Use the same condition definition accepted by Analysis user-cluster commands:
25
25
  "relation": "and",
26
26
  "items": [
27
27
  {
28
- "type": "user_property",
29
- "property": "vip_level",
28
+ "type": "user",
29
+ "field": "vip_level",
30
30
  "operator": "eq",
31
- "value": "gold"
31
+ "values": ["gold"]
32
32
  },
33
33
  {
34
- "type": "event_behavior",
34
+ "type": "event",
35
35
  "event": "purchase",
36
36
  "aggregation": "count",
37
37
  "operator": "gte",
38
38
  "value": 2,
39
- "time": {
40
- "type": "relative",
39
+ "time_range": {
40
+ "mode": "recent",
41
41
  "unit": "day",
42
42
  "value": 7
43
43
  }
@@ -48,8 +48,13 @@ Use the same condition definition accepted by Analysis user-cluster commands:
48
48
  ```
49
49
 
50
50
  Before writing, resolve real event and property names through Analysis metadata commands. Never invent names or copy internal calculation codes from historical output.
51
+ Use only the documented semantic fields. Unknown fields are rejected; property `field` accepts a
52
+ technical-name string or a `{name,type}` reference.
51
53
 
52
- Nested `and`/`or`, user properties, event behavior, include/exclude existing clusters, relative time, and custom time use the Analysis semantic shape documented by `ae-analysis`.
54
+ Nested `and`/`or`, user properties, event behavior, `behavior_sequence`, include/exclude existing
55
+ clusters, relative time, and custom time use the Analysis semantic shape documented by
56
+ `ae-analysis`. A `get` response may contain top-level `compound` nodes when stored member,
57
+ event, and outer relations differ. Preserve those compounds when updating the strategy.
53
58
 
54
59
  ## Create or update
55
60