@thinkingai/ae-cli 6.1.17 → 6.1.18

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 (99) hide show
  1. package/dist/{auth-2WTQOP77.js → auth-GBMV6TEJ.js} +3 -3
  2. package/dist/{auth-77BUFLGC.js → auth-ROB2EDYV.js} +12 -13
  3. package/dist/{capability-72DTW5M2.js → capability-DKMYUTLC.js} +50 -13
  4. package/dist/{capability-PJHNI4GJ.js → capability-HYVVPG25.js} +49 -12
  5. package/dist/chunk-3FY3RJ26.js +293 -0
  6. package/dist/{chunk-PTE56QPL.js → chunk-3KWQYGYI.js} +4 -0
  7. package/dist/{chunk-UOUS37JQ.js → chunk-4XXOWOTA.js} +3 -3
  8. package/dist/{chunk-GT46FPXN.js → chunk-BYYS3ANB.js} +17 -8
  9. package/dist/{chunk-YA6SMTXG.js → chunk-EFH4XWYC.js} +3 -3
  10. package/dist/{chunk-4SGZG4XY.js → chunk-J2DEBMRF.js} +9 -7
  11. package/dist/{chunk-LYVNONC4.js → chunk-JHENBQ5B.js} +35 -0
  12. package/dist/{chunk-VR3LCBHW.js → chunk-JRJY5DMJ.js} +5 -5
  13. package/dist/{chunk-ILIU36SU.js → chunk-OMPRXM3V.js} +3 -3
  14. package/dist/{chunk-VPKZ7I72.js → chunk-QNOLN2LJ.js} +2 -2
  15. package/dist/{chunk-SAU3QFIQ.js → chunk-QZ3AS4KK.js} +3 -3
  16. package/dist/chunk-RJDU7NYP.js +1198 -0
  17. package/dist/{chunk-4KVPKXFX.js → chunk-RNAALWJK.js} +2 -2
  18. package/dist/{chunk-C4MGVGJW.js → chunk-SERWF6G5.js} +1 -1
  19. package/dist/{chunk-RGKJGKT7.js → chunk-Y3LOALAV.js} +5 -5
  20. package/dist/{chunk-P3FGXJTU.js → chunk-ZQ47LWTI.js} +4 -4
  21. package/dist/chunk-ZQKDZXDO.js +317 -0
  22. package/dist/{client-TKG4WBHN.js → client-L2YDMHQ6.js} +5 -4
  23. package/dist/{community-report-client-FI4LNVYS.js → community-report-client-C7WDGET3.js} +1 -2
  24. package/dist/{config-RE6CMGPK.js → config-BMYZX2UE.js} +7 -6
  25. package/dist/{data-integration-XQYB4X4F.js → data-integration-QEKDWQDY.js} +1601 -192
  26. package/dist/index.js +131 -1241
  27. package/dist/{local-data-upload-client-BWHSUQQK.js → local-data-upload-client-4YYHSYD6.js} +1 -2
  28. package/dist/{memory-CHRU2F7W.js → memory-3ORCR7JH.js} +6 -6
  29. package/dist/{memory-YK33G4T7.js → memory-I2WXDTV2.js} +5 -5
  30. package/dist/{metadata-XXR34N5P.js → metadata-I4C2EWUN.js} +10 -10
  31. package/dist/{metadata-UILXHBWF.js → metadata-VUOQJE26.js} +9 -9
  32. package/dist/{model-NR3JHFSJ.js → model-HLHIEFMU.js} +5 -5
  33. package/dist/{model-K3KLWIW6.js → model-UGRDX4MW.js} +6 -6
  34. package/dist/personal-semantic-preference-LIPACBDX.js +239 -0
  35. package/dist/personal-semantic-preference-OEISBRHM.js +239 -0
  36. package/dist/project-semantic-FFPWFPIW.js +1114 -0
  37. package/dist/project-semantic-RT3R2VQD.js +1114 -0
  38. package/dist/{sync-FCKOVWWS.js → sync-HKIOZXQE.js} +6 -6
  39. package/dist/{sync-DAVKYVMW.js → sync-TFHU2UTG.js} +7 -7
  40. package/dist/{te-agent-HLW4VTQK.js → te-agent-BR6VDBNX.js} +9 -8
  41. package/dist/{te-agent-4BKBODMF.js → te-agent-VLYOV7S4.js} +8 -7
  42. package/dist/{te-analysis-ZMNGOVNW.js → te-analysis-4YGQL5RC.js} +437 -38
  43. package/dist/{te-analysis-O6DCO6BS.js → te-analysis-7VUNUYWZ.js} +436 -37
  44. package/dist/{te-community-HLC43QKH.js → te-community-5DMNKJWY.js} +5 -5
  45. package/dist/{te-community-6HPBWJUZ.js → te-community-ISDQWJU7.js} +6 -6
  46. package/dist/{te-dataops-HDRUXY4K.js → te-dataops-6P5IKWNJ.js} +8 -7
  47. package/dist/{te-dataops-EJP56W3K.js → te-dataops-CVULXNVB.js} +7 -6
  48. package/dist/{te-engage-RAK5PESW.js → te-engage-KZPR5R22.js} +9 -9
  49. package/dist/{te-engage-FGBGQ4IY.js → te-engage-N5WI32H6.js} +8 -8
  50. package/dist/{te-experiment-SO5MPDMJ.js → te-experiment-6BITX4RD.js} +226 -8
  51. package/dist/{te-experiment-VZF7BT6G.js → te-experiment-UVR4HLND.js} +227 -9
  52. package/dist/{te-kb-SQCLHG6X.js → te-kb-RCLSSH2Q.js} +7 -7
  53. package/dist/{te-system-Z77IKZFN.js → te-system-FXITO2JG.js} +5 -5
  54. package/dist/{te-system-YARIK4S5.js → te-system-K2GYMCTB.js} +6 -6
  55. package/dist/{te-team-EFKWYKMK.js → te-team-ADOC2ROP.js} +6 -6
  56. package/dist/{update-OGPSZM5A.js → update-YCYCKJOO.js} +7 -6
  57. package/package.json +1 -1
  58. package/skills/ae-agent/SKILL.md +3 -4
  59. package/skills/ae-agent/references/edit-skill.md +3 -0
  60. package/skills/ae-agent/references/get-skill-content.md +1 -1
  61. package/skills/ae-agent/references/rescan-skills.md +15 -13
  62. package/skills/ae-agent/references/upload-skill.md +7 -4
  63. package/skills/ae-analysis/SKILL.md +45 -4
  64. package/skills/ae-analysis/metadata_resolution.md +38 -4
  65. package/skills/ae-analysis/references/analysis_data_retrieval.md +29 -0
  66. package/skills/ae-analysis/references/asset_authentication_export.md +22 -0
  67. package/skills/ae-analysis/references/asset_authentication_list.md +18 -14
  68. package/skills/ae-analysis/references/asset_authentication_update.md +29 -14
  69. package/skills/ae-analysis/references/command_index.md +17 -9
  70. package/skills/ae-analysis/references/dashboard_get.md +18 -1
  71. package/skills/ae-analysis/references/dashboard_update.md +3 -0
  72. package/skills/ae-analysis/references/personal_semantic_preference_add.md +23 -0
  73. package/skills/ae-analysis/references/personal_semantic_preference_delete.md +17 -0
  74. package/skills/ae-analysis/references/personal_semantic_preference_get.md +19 -0
  75. package/skills/ae-analysis/references/personal_semantic_preference_list.md +21 -0
  76. package/skills/ae-analysis/references/personal_semantic_preference_update.md +19 -0
  77. package/skills/ae-data-integration/SKILL.md +23 -4
  78. package/skills/ae-data-integration/references/custom-layer.md +93 -0
  79. package/skills/ae-data-integration/references/error-handling.md +92 -0
  80. package/skills/ae-data-integration/references/handoff.md +77 -18
  81. package/skills/ae-data-integration/references/local-analysis.md +1 -1
  82. package/skills/ae-data-integration/references/reuse.md +9 -5
  83. package/skills/ae-data-integration/references/sink-upload.md +1 -1
  84. package/skills/ae-data-integration/references/source-inspect.md +18 -12
  85. package/skills/ae-data-integration/references/tracking-plan.md +7 -5
  86. package/skills/ae-data-integration/references/transform.md +10 -10
  87. package/skills/ae-data-integration/references/ue-mapping.md +33 -11
  88. package/skills/ae-engage/references/build-task-save-guide.md +9 -0
  89. package/skills/ae-engage/references/save-task.md +82 -0
  90. package/skills/ae-experiment/SKILL.md +8 -2
  91. package/skills/ae-experiment/references/manage_feature_whitelist.md +66 -0
  92. package/skills/ae-experiment/references/manage_guardrail_metrics.md +26 -0
  93. package/skills/ae-experiment/references/save_experiment.md +1 -1
  94. package/skills/ae-kb/SKILL.md +1 -1
  95. package/skills/ae-project-semantic/SKILL.md +193 -0
  96. package/skills/ae-project-semantic/references/query-routing-v5.md +165 -0
  97. package/skills/ae-project-semantic/references/recommendation-quality.md +68 -0
  98. package/dist/chunk-QGM4M3NI.js +0 -37
  99. package/dist/chunk-ZZUOD757.js +0 -598
@@ -10,15 +10,15 @@ Generate and confirm the event/property plan **before** any transform or upload.
10
10
  ## Sub-steps
11
11
 
12
12
  1. **Event-model decision** — reuse the UE routing result: single-table single-event `track`, single-table multi-event (event-name column), `user_set`, or `mixed`. The agent may propose splitting one table into several events (for example an ad table into `ad_show`/`ad_click` by `campaign_type`); that proposal must be confirmed by the user in the confirmation gate.
13
- 2. **Column → property draft** — identify system columns (time, `distinct_id`/`account_id`, event-name column, user-property-name column); map the remaining columns to event / user / common properties. Name events and properties in snake_case and fill **every** `display_name`, `desc`, and `event_tag` (events also carry `event_desc`). Infer all three from field names, value distribution, samples, and business-doc / prompt priors — never leave them empty: `desc`/`event_desc` state what the item means in plain language (language follows the user), and `event_tag` picks the closest category from the canonical tag list (see the `event_tag` appendix in `../../ae-generate-tracking-plan/references/business-dimension-mapping.md`). When you cannot infer a `desc` or `event_tag`, mark it pending and ask the user for it inside the confirmation gate. Infer types (`number` / `bool` / `datetime` / enum) the same way; CSV defaults to `string`. Columns that stay uncertain or conflicting are marked pending and asked only inside the confirmation gate.
14
- 3. **Confirmation gate (single, one pass)** — present one summary table: event list + property list (uncertain types highlighted) + field scope (default: plan fields only, with a full-import switch) + unrecognized/dirty-data handling. The user answers once with ok or edits (renames, types, add/drop columns).
13
+ 2. **Column → property draft** — confirm the recommended mapping's key system fields with the user **before** drafting: `mode` (`#type`), `#account_id`/`#distinct_id` (ask together; at least one is required — a `user_id` column can be either an anonymous or a login ID and only the user knows), `#time` + source timezone + `#zone_offset`, `#event_name` (track only; the event column or a reviewed `default_event_name`), and `#ip`/`#uuid` when the data has such a column. The exact questions and the never-infer-from-a-column-name-alone rule are [transform.md](transform.md) steps 1–5; run them here. The plan is generated from this mapping, so never draft from an unconfirmed mapping. With the system fields settled, map the remaining columns to event and/or user properties (the mapping `mode` decides). Common event properties — project-level super properties attached to every event — are defined by `ae-generate-tracking-plan`, not this import path. Name events and properties in snake_case and fill **every** `display_name`, `desc`, and `event_tag` (events also carry `event_desc`). Infer all three from field names, value distribution, samples, and business-doc / prompt priors — never leave them empty: `desc`/`event_desc` state what the item means in plain language (language follows the user), and `event_tag` picks the closest category from the canonical tag list (see the `event_tag` appendix in `../../ae-generate-tracking-plan/references/business-dimension-mapping.md`). When you cannot infer a `desc` or `event_tag`, mark it pending and ask the user for it inside the confirmation gate. Infer types (`number` / `bool` / `datetime` / enum) the same way; CSV defaults to `string`. Columns that stay uncertain or conflicting are marked pending and asked only inside the confirmation gate.
14
+ 3. **Confirmation gate (single, one pass)** — present the concrete plan, never a counts-only summary: the confirmed key system-field mapping (`mode`, `#account_id`/`#distinct_id`, `#time` + source timezone, `#event_name`; `#ip`/`#uuid` when present), then a full event table (one row per event: `event_name` + `event_tag`/`event_desc` + the properties attached to it), then a full property table (one row per property: source column → target AE name → type → `display_name`/`desc`, uncertain types highlighted; a kept-whole `object`/`array_row` lists its `parent.child` sub-properties next to the parent), plus field scope (default: plan fields only, with a full-import switch) and unrecognized/dirty-data handling. For a multi-sheet workbook, group the property table by sheet so each sheet's source columns are visible. The user answers once with ok or edits (renames, types, identity/time/event columns, add/drop columns).
15
15
  4. **Merge with the existing plan** — fetch the project's current tracking plan; same-name property type conflicts are severe, same-name events are advisory; decide append vs replace. This runs for **every** file, not just the first: when the project already has a plan (an earlier file or run), diff this file's events and properties against it and put the additions — new events, new properties, new object sub-properties from flattening — in the confirmation gate. An existing plan is never a reason to skip this step; only when every addition is already present may you skip the merge, and even then state and confirm that fact with the user.
16
- 5. **Persist the plan** — draft.json → xlsx → upload with `sdk_integration_mode=none`.
16
+ 5. **Persist the plan** — `.ae-cli/data-integration/draft.json``.ae-cli/data-integration/draft.xlsx` → upload with `sdk_integration_mode=none`.
17
17
  6. **Hand off the field mapping** — the confirmed plan plus column→property mapping, `value_mapping`, and `flatten_rules` feed the Transform submodule.
18
18
 
19
19
  ## CLI
20
20
 
21
- `ae-cli data-integration plan --mapping <mapping> [--event-name <name>...] [--plan-name <name>] [--out <draft.json>] [--dry-run]` converts the confirmed `ae-local-data-mapping/v1` mapping into a tracking-plan `draft.json` with `sdk_integration_mode=none` and `source_type=data`.
21
+ `ae-cli data-integration plan --mapping <mapping> [--event-name <name>...] [--plan-name <name>] [--out .ae-cli/data-integration/draft.json] [--dry-run]` converts the confirmed `ae-data-integration-mapping/v1` mapping into a tracking-plan `draft.json` with `sdk_integration_mode=none` and `source_type=data`.
22
22
 
23
23
  - `user_set` mode → no events; every mapping property becomes a user property.
24
24
  - `track` mode → one event per `--event-name` (or the mapping `default_event_name`); every property becomes an event property.
@@ -26,9 +26,11 @@ Generate and confirm the event/property plan **before** any transform or upload.
26
26
  - `exclude_columns` are dropped from the draft.
27
27
  - `desc` and `event_tag` flow from the mapping: each property's `desc` (falling back to its source column name) and each event's `event_meta.<name>.desc` / `event_meta.<name>.tag` (falling back to the source event name) are written into the draft. Fill them in the mapping so the plan is never empty.
28
28
  - The per-row event-name column cannot be enumerated without a full scan, so when `default_event_name` is absent the CLI requires `--event-name` for each concrete event name.
29
+ - Duplicate `display_name`s across the property pool are auto-deduplicated (the property name is appended) before validation, so same-named source columns under different object paths never collide. Dotted `target`s default each sub-property's `display_name`/`desc` to its leaf segment, which also avoids collisions.
30
+ - The draft is validated locally before any upload: an `object`/`array_row` property with no `parent.child` sub-property, or a sub-property whose type is `object`/`array_row`, fails fast with `LOCAL_DATA_PLAN_INVALID_DRAFT` (`--dry-run` fails too). Fix it in the mapping before running `plan`: a mapping `properties` entry with a dotted `target` (`user_info.name`) declares a `parent.child` sub-property whose parent is the `object`/`array_row` entry with the same first segment — so a kept whole container must carry one dotted entry per child (each scalar or `list`) next to the parent entry. A nested object/object-array that cannot stay nested must instead be flattened to scalar leaves: record one `flatten_rules` entry per leaf and one flat scalar (or `list`) `properties` entry per leaf (see [source-inspect.md](source-inspect.md)).
29
31
  - `--dry-run` previews events and properties without writing `draft.json`.
30
32
 
31
- Afterward reuse `ae-cli tracking plan draft --in draft.json --out draft.xlsx` and `ae-cli tracking plan validate / upload` for xlsx generation and ingestion.
33
+ Afterward reuse `ae-cli tracking plan draft --in .ae-cli/data-integration/draft.json --out .ae-cli/data-integration/draft.xlsx` and `ae-cli tracking plan validate / upload` for xlsx generation and ingestion.
32
34
 
33
35
  ## Reuse
34
36
 
@@ -1,6 +1,6 @@
1
1
  # Transform — column → UE mapping
2
2
 
3
- Precondition: the tracking plan ([tracking-plan.md](tracking-plan.md)) has been generated and confirmed. A field mapping is not a tracking plan; if the plan is missing, return to tracking-plan.md first.
3
+ Precondition: the tracking plan ([tracking-plan.md](tracking-plan.md)) has been generated and confirmed. A field mapping is not a tracking plan; if the plan is missing, return to tracking-plan.md first. The key system fields (steps 1–5 below) were already confirmed during the tracking-plan step (tracking-plan.md step 2); if nothing changed, state the confirmed values once and move to the property set — never skip a confirmation the user has not actually given.
4
4
 
5
5
  Read [UE mapping](ue-mapping.md) and apply these gates:
6
6
 
@@ -12,10 +12,10 @@ Read [UE mapping](ue-mapping.md) and apply these gates:
12
12
  Confirm the system fields with the user before touching properties. These are the top-level `#` fields, and users may not understand them, so explain each in plain language before asking; never infer a decision from a column name alone.
13
13
 
14
14
  1. **`#type` / mode.** Confirm the recommendation's `mode` (`track` / `user_set` / `mixed`). If `record_type_field` is set, confirm each distinct value normalizes to one of the eight record types. Ask whether the data reports events (→ `track`) or modifies user profiles (→ `user_set` or another profile type).
15
- 2. **`#account_id` and `#distinct_id` — ask together; at least one is required.** Explain both: `#account_id` identifies logged-in users (database `user_id`, phone, member ID); `#distinct_id` identifies anonymous visitors (device/cookie/visitor ID). Present every `identity_candidates` entry from the inspect result alongside the recommendation's `account_id_field`/`distinct_id_field` picks, and ask which column maps to `#account_id`, which to `#distinct_id`, and whether both apply. A column named `user_id` can be either an anonymous or a login ID — only the user knows. If a required identity column is missing, offer an explicit `account_id_value`/`distinct_id_value` placeholder or `random_pool`; never invent one.
15
+ 2. **`#account_id` and `#distinct_id` — ask together; at least one is required.** Explain both: `#account_id` identifies logged-in users (database `user_id`, phone, member ID); `#distinct_id` identifies anonymous visitors (device/cookie/visitor ID). Present every `identity_candidates` entry from the inspect result alongside the recommendation's `account_id_field`/`distinct_id_field` picks, and ask which column maps to `#account_id`, which to `#distinct_id`, and whether both apply. A column named `user_id` can be either an anonymous or a login ID — only the user knows. If a required identity column is missing, offer an explicit `account_id_value`/`distinct_id_value` placeholder or `random_pool`; never invent one. `identity_candidates` is name-matched only, so it misses identity columns with arbitrary names (`玩家ID`, `用户账号`, `player_name`); surface any column whose shape is identifier-like (high `unique_ratio`, low `missing_ratio`, a string or numeric key, not a time column) and ask the user what it is. When one file has multiple sheets/data-sets, cross-check identity columns across them before finalizing: a column that appears (or near-matches, e.g. `设备ID` vs `主设备ID`) in more than one sheet likely has the same business meaning, so present a per-sheet `#account_id`/`#distinct_id` view and ask whether the same column maps to the same system field everywhere — a device ID used as `#distinct_id` in the event sheet but left as a differently-named plain property in the profile sheet silently breaks anonymous-user linkage, so surface the mismatch and let the user decide rather than letting it pass silently.
16
16
  3. **`#time`.** Confirm the time column and the source timezone (an IANA name from the user/project context). Leave `time_format` unset unless auto-detection failed (US/EU ambiguous dates). Also confirm the data's `#zone_offset` — the whole-hour UTC offset AE applies to those times, emitted inside `properties` (not top-level). The property's value is a number, so ask the user in numeric terms ("is the offset 8, i.e. UTC+8?") and set `zone_offset_value` to that integer; when a column carries the offset per row, set `zone_offset_field` instead. The two are mutually exclusive.
17
17
  4. **`#event_name` (track only).** Confirm the event-name column, or a reviewed `default_event_name` when no column exists.
18
- 5. **`#ip` / `#uuid` (optional).** Ask only when the data has an IP- or UUID-like column; map it via `ip_field`/`uuid_field`, otherwise skip.
18
+ 5. **`#ip` / `#uuid` (optional).** Ask only when the data has an IP- or UUID-like column; map it via `ip_field`/`uuid_field`, otherwise skip. `#ip` is event data only and must be a valid IPv4/IPv6 address (a private/LAN IP is kept but reported — AE cannot geolocate it); `#uuid` must be a standard 36-character UUID. A value that violates the spec is dropped from that row only (`INVALID_IP` / `INVALID_UUID`) — the row itself is kept. The program never auto-generates a `#uuid`.
19
19
 
20
20
  When an `#event_name`, `#account_id`, or `#distinct_id` column's values do not satisfy AE naming rules (pure Chinese, uppercase, spaces), do not stop — scan the distinct values, list them to the user, and ask for one AE-name replacement each; record the pairs in `value_mapping` (see [UE mapping](ue-mapping.md)). A value with no matching key keeps its original text and fails validation, so confirm every distinct value is covered or excluded. The same mechanism applies to a property column via that entry's own `value_mapping`.
21
21
 
@@ -24,18 +24,18 @@ Then confirm the property set with the user before saving the mapping. Present e
24
24
  Walk the table item by item:
25
25
 
26
26
  1. **Auto-renamed targets.** Recommendation sanitizes column names (camelCase split, illegal chars → `_`, digit-leading → `field_`, nothing recognizable → `field_N`). Show each source → target; ask for a manual name for every `field_N` fallback and rewrite the `target`.
27
- 2. **Types.** Confirm each inferred type (`number`/`string`/`boolean`/`datetime`/`list`/`object`). ID-like columns stay `string` even when numeric; `object`/`list` columns carry `transform: 'json'`. A type is locked on first receipt, so review it before committing. If the user changes a type, warn how many rows would fail coercion — `convert` reports each failing row with its error code, so run it with the tentative mapping and confirm the quarantined count before finalizing.
27
+ 2. **Types.** Confirm each inferred type (`number`/`string`/`boolean`/`datetime`/`list`/`object`/`array_row`). ID-like columns stay `string` even when numeric; `object`/`array_row`/`list` columns carry `transform: 'json'`. A scalar array is `list` (→ AE `array_string`); an object array is `array_row` (→ AE `array_row`). A type is locked on first receipt, so review it before committing. If the user changes a type, warn how many rows would fail coercion — `convert` reports each failing row with its error code, so run it with the tentative mapping and confirm the quarantined count before finalizing.
28
28
  3. **Exclusions.** Ask which columns to drop and record them as `exclude_columns`.
29
29
 
30
30
  Before saving, present the complete mapping for a final sign-off on one grouped page — system fields (`#type`/mode, `#account_id`, `#distinct_id`, `#time` + source timezone, `#zone_offset`, `#event_name`, `#ip`/`#uuid`), then the property table (source column → target AE name → type), then excluded columns — and wait for an explicit yes. Never dump the raw mapping JSON at the user.
31
31
 
32
- Save the reviewed `ae-local-data-mapping/v1` JSON locally. Convert into a new output directory:
32
+ Save the reviewed `ae-data-integration-mapping/v1` JSON to `.ae-cli/data-integration/mapping.json` (project workspace). Convert into a new output directory:
33
33
 
34
34
  ```bash
35
35
  ae-cli data-integration convert \
36
36
  --input-file '<path>' \
37
- --mapping '<mapping.json>' \
38
- --output-dir '.ae-cli/data-integration/<run-id>'
37
+ --mapping '.ae-cli/data-integration/mapping.json' \
38
+ --output-dir '.ae-cli/data-integration/runs/<run-id>'
39
39
  ```
40
40
 
41
41
  For multiple files, repeat `--input-file` and pass a wildcard mapping plus `--type-resolutions` when inspect reported conflicts:
@@ -45,10 +45,10 @@ ae-cli data-integration convert \
45
45
  --input-file '<a.csv>' --input-file '<b.csv>' \
46
46
  --mapping '<wildcard-mapping.json>' \
47
47
  --type-resolutions '<resolutions.json>' \
48
- --output-dir '.ae-cli/data-integration/<run-id>'
48
+ --output-dir '.ae-cli/data-integration/runs/<run-id>'
49
49
  ```
50
50
 
51
- The command never modifies the source. Inspect `manifest.json`; summarize valid and quarantined counts and the block reason. Do not expose rows from `invalid.rows.jsonl` unless the user specifically asks to inspect the local quarantine.
51
+ The command never modifies the source. Inspect `manifest.json`; summarize valid and quarantined counts and the block reason. If `manifest.output.skipped_fields` is present, tell the user how many `#ip`/`#uuid` values were invalid and dropped (the rows were otherwise kept); if `manifest.output.lan_ip_records` is present, tell the user that many `#ip` values are private/LAN addresses that AE cannot geolocate. Neither blocks the manifest. If `manifest.output.flatten_misses` is present — or a stderr `Warning: flatten rule "X" did not materialize for N row(s).` fires — a `flatten_rules` path missed some rows: re-check the dot path against the source shape (or confirm the column is legitimately optional); the rows are otherwise kept. A stderr `Warning: … column count different from the header row …` means ragged CSV/TSV rows were tolerated (extra fields dropped, missing fields treated as empty) — surface it as a data-quality note. A blocked manifest whose reason is `The source contained no data rows.` means the file had zero data rows; do not re-run the same command on it. Do not expose rows from `invalid.rows.jsonl` unless the user specifically asks to inspect the local quarantine. For the full failure taxonomy and how to respond, see [error handling](error-handling.md).
52
52
 
53
53
  ## Re-report only the failed rows (salvage loop)
54
54
 
@@ -59,7 +59,7 @@ ae-cli data-integration convert \
59
59
  --input-file '<same-source>' \
60
60
  --mapping '<fixed-mapping.json>' \
61
61
  --salvage-from '<run-dir>/invalid.rows.jsonl' \
62
- --output-dir '.ae-cli/data-integration/<run-id>-salvage'
62
+ --output-dir '.ae-cli/data-integration/runs/<run-id>-salvage'
63
63
  ```
64
64
 
65
65
  This emits a `valid.ue.jsonl` containing only the rows that now pass, plus a new `invalid.rows.jsonl` with whatever still fails. Fixes are rarely one-shot, so repeat: feed each round's `invalid.rows.jsonl` into the next `--salvage-from` until no rows fail or the user stops. Each round's `valid.ue.jsonl` is disjoint from earlier rounds', so upload each round independently (same confirmation and `--allow-clean-subset` gates as a normal upload). `--salvage-from` is single-file only and the source must be the same file that produced the quarantine.
@@ -1,12 +1,12 @@
1
1
  # UE mapping contract
2
2
 
3
- The mapping version is `ae-local-data-mapping/v1`.
3
+ The mapping version is `ae-data-integration-mapping/v1`.
4
4
 
5
5
  Required structure:
6
6
 
7
7
  ```json
8
8
  {
9
- "version": "ae-local-data-mapping/v1",
9
+ "version": "ae-data-integration-mapping/v1",
10
10
  "source": {
11
11
  "sha256": "<source-sha256>",
12
12
  "format": "csv",
@@ -54,10 +54,25 @@ Top-level `#` fields map from named source columns. The user confirms each mappi
54
54
  | `#account_id` | Login/account ID (database `user_id`, phone, member ID) — identifies authenticated users | At least one of `#distinct_id` / `#account_id` |
55
55
  | `#time` | Event/profile occurrence time; AE bins data by it | Yes |
56
56
  | `#event_name` | What the user did (`purchase`, `login`) | Only for `track` |
57
- | `#ip` | Client IP; AE resolves geo from it | No |
58
- | `#uuid` | Short-window deduplication ID | No |
57
+ | `#ip` | Client IP; AE resolves geo from it. Event data only | No |
58
+ | `#uuid` | Standard 36-character UUID uniquely identifying the record (dedup). Both event and user data | No |
59
59
 
60
- `#zone_offset` is a preset property that tells AE the data's UTC offset (whole hours, -12..14) so `#time` is interpreted correctly. Unlike the fields above it lives **inside `properties`**, not at the top level. Provide it via `zone_offset_value` (a whole-hour integer such as `8` for UTC+8; an IANA name is also accepted and resolved to its offset at conversion time — sub-hour zones round to the nearest whole hour and DST zones reflect the offset then in effect, so historical data crossing a DST boundary should use `zone_offset_field`) or `zone_offset_field` (a source column carrying the offset per row); the two are mutually exclusive. Rows whose `zone_offset_field` value is missing or not an integer in -12..14 are quarantined.
60
+ `#zone_offset` is a preset property that tells AE the data's UTC offset (whole hours, -12..14) so `#time` is interpreted correctly. Unlike the fields above it lives **inside `properties`**, not at the top level. Provide it via `zone_offset_value` (a whole-hour integer such as `8` for UTC+8; an IANA name is also accepted and resolved to its offset at conversion time — sub-hour zones round to the nearest whole hour and DST zones reflect the offset then in effect, so historical data crossing a DST boundary should use `zone_offset_field`) or `zone_offset_field` (a source column carrying the offset per row); the two are mutually exclusive. Rows whose `zone_offset_field` value is missing or not an integer in -12..14 are quarantined. `#zone_offset` is event data only — user profile records never carry it.
61
+
62
+ ## Value specifications
63
+
64
+ Each mapped system field carries a value spec, enforced at both inspect (warnings) and convert (row handling). A row error quarantines the whole row; a field skip drops only that field and keeps the row.
65
+
66
+ | Field | Value spec | On violation (convert) |
67
+ | --- | --- | --- |
68
+ | `#account_id` / `#distinct_id` | Non-empty string, at most 128 characters | Row error `MISSING_USER_ID` (absent) / `USER_ID_TOO_LONG` (>128) |
69
+ | `#event_name` | `^[a-z][a-z0-9_]{0,49}$` (lowercase snake_case, letter-leading, ≤50 chars) | Row error `INVALID_EVENT_NAME` |
70
+ | `#time` | One of the supported formats, within 3 years back / 3 days forward | Row error `INVALID_TIME` / `TIME_OUT_OF_RANGE` |
71
+ | `#ip` | Valid IPv4 or IPv6. Event data only | Field skip `INVALID_IP`; a private/LAN IP is kept and reported — AE cannot geolocate it |
72
+ | `#zone_offset` | Integer -12..14 (or an IANA name for `zone_offset_value`). Event data only | Row error `INVALID_ZONE_OFFSET` |
73
+ | `#uuid` | Standard 36-character UUID (`xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx`). Both data kinds | Field skip `INVALID_UUID` |
74
+
75
+ A field skip is not a row failure: the row is kept with its other fields, and the count is reported in `manifest.output.skipped_fields` so the agent tells the user at the end. `#uuid` is never auto-generated — it comes only from a mapped source column.
61
76
 
62
77
  Mapping keys: `account_id_field`, `distinct_id_field`, `time.field`, `event_name_field` (or a reviewed `default_event_name`), `ip_field`, `uuid_field`. Inspect surfaces every identity-shaped column in `identity_candidates` (name, `account`/`distinct` kind, unique and missing ratios) so the agent can present all candidates for confirmation. When the required identity column is absent, use an explicit `account_id_value`/`distinct_id_value` placeholder or `random_pool` — a user decision, never invented.
63
78
 
@@ -86,16 +101,20 @@ All fields below are optional and are explicit user decisions — never invent t
86
101
  | `account_id_value` / `distinct_id_value` | `string` | Fixed placeholder identity (≤128 chars). Applies to every row when the corresponding `*_field` is absent; when the field exists, fills only the rows whose column is empty |
87
102
  | `random_pool` | `{ account_ids?: string[], distinct_ids?: string[] }` | Synthesizes a random identity when the source field is absent |
88
103
  | `exclude_columns` | `string[]` | Source columns skipped when building properties |
89
- | `flatten_rules` | `{ outColumn: 'dot.path' }` | Nested flatten map. NDJSON/JSON paths are from the record root (`user_info.name`); CSV/TSV paths are `<column>.<cell-relative path>` into a JSON-encoded object cell (`user_profile.name`) — add the source column to `exclude_columns` when flattening it |
104
+ | `flatten_rules` | `{ outColumn: 'dot.path' }` | Nested flatten map. NDJSON/JSON paths are from the record root (`user_info.name`); CSV/TSV/Excel paths are `<column>.<cell-relative path>` into a JSON-encoded object cell (`user_profile.name`) — add the source column to `exclude_columns` when flattening it. `flatten_rules` only materializes the out column in the row; it does **not** emit it — add a `properties` entry with `source` = the out column to actually produce the property. An out column that fails to materialize for some rows (missing path, non-JSON cell, or a path without a `<column>.` prefix) is counted per out-column in `manifest.output.flatten_misses` and named in a convert stderr warning — fix the path or confirm the column is legitimately optional |
90
105
  | `headers` | `string[]` | User-confirmed column names for a headerless file; presence means the first row is data. Never use inspect's `col_1..col_N` placeholders — infer names from each column's values, confirm them with the user, then write them here |
91
106
  | `missing_time` | `'now'` | Fill a missing/empty `#time` with the current time, for user-profile rows only (explicit user decision; track rows are never filled) |
92
- | `ip_field` | `string` | Source column emitted as the top-level `#ip` system field (client IP; AE resolves geo) |
93
- | `uuid_field` | `string` | Source column emitted as the top-level `#uuid` system field (short-window deduplication ID) |
107
+ | `ip_field` | `string` | Source column emitted as the top-level `#ip` system field (client IP; AE resolves geo). Event data only; a value that is not valid IPv4/IPv6 is dropped from that row, and a private/LAN IP is kept but reported |
108
+ | `uuid_field` | `string` | Source column emitted as the top-level `#uuid` system field (standard 36-character UUID, both data kinds). A non-UUID value is dropped from that row |
94
109
  | `zone_offset_value` | `number` (integer -12..14) or IANA `string` | Emits the fixed `#zone_offset` preset property inside `properties`. An IANA name resolves to its integer UTC offset |
95
110
  | `zone_offset_field` | `string` | Source column whose per-row integer value (-12..14) is emitted as `#zone_offset`; missing/non-integer rows are quarantined. Mutually exclusive with `zone_offset_value` |
96
111
  | `event_meta` | `{ <event-name>: { desc?: string, tag?: string } }` | Per-event business description and `event_tag` for the tracking plan, keyed by AE event name. Inferred from the data and user context; the user supplies anything not inferable — never leave them empty |
97
112
 
98
- Each `properties` entry may also carry `value_mapping` (per-property exact-key replacement), `transform` (one of `stringify`, `number`, `boolean`, `json`), `time_format` (only meaningful for `type: 'datetime'`), and `desc` (business description for the tracking plan; inferred, or user-provided when not inferable). Container columns (`object`/`list`) whose values arrive as JSON text — JSON-encoded CSV cells, or flattened NDJSON leaves — must set `transform: 'json'` so conversion parses the text back into a native object/array; it is a safe no-op when the value already arrived native.
113
+ Each `properties` entry may also carry `value_mapping` (per-property exact-key replacement), `transform` (one of `stringify`, `number`, `boolean`, `json`), `time_format` (only meaningful for `type: 'datetime'`), and `desc` (business description for the tracking plan; inferred, or user-provided when not inferable). Container columns (`object`/`array_row`/`list`) whose values arrive as JSON text — JSON-encoded CSV/TSV/Excel cells, or flattened NDJSON leaves — must set `transform: 'json'` so conversion parses the text back into a native object/array; it is a safe no-op when the value already arrived native.
114
+
115
+ A `properties` entry whose `target` is dotted (`parent.child`) is a plan-only sub-property declaration: `parent` must name an `object`/`array_row` entry in the same mapping, the child must be scalar or `list`, and the child's `source` must equal the parent's `source` — the nested value lives inside the parent, which conversion emits once and never reads the child's column. A kept whole `object`/`array_row` therefore carries one dotted entry per child alongside the parent entry.
116
+
117
+ Property types are `string`, `number`, `boolean`, `datetime`, `list`, `object`, and `array_row`. `list` is a scalar array (`["a","b"]`, → AE `array_string`); `object` is a one-to-one object (`{...}`); `array_row` is an object array (`[{...}]`, one-to-many). A mapping expresses an object's/object array's sub-properties as dotted `target`s (`user_info.name`, `orders.sku`); `data-integration plan` maps them one-to-one to `parent.child` plan properties (each child's `display_name`/`desc` default to its leaf segment). In the tracking plan, `object` and `array_row` properties must each have at least one `parent.child` sub-property, and every sub-property must itself be scalar or `array_string` — a nested object/object-array cannot stay nested and must be flattened further to scalar leaves. `list` (→ `array_string`) is a leaf and takes no children. `ae-cli data-integration plan` enforces this locally: a composite property with no children, or a child that is `object`/`array_row`, fails fast with `LOCAL_DATA_PLAN_INVALID_DRAFT` before any upload.
99
118
 
100
119
  ## Time formats
101
120
 
@@ -130,13 +149,16 @@ Values with an explicit offset or `Z` are parsed by the JavaScript `Date` constr
130
149
  - `#zone_offset`, when set, is a whole-hour integer in -12..14 (or an IANA name/column that resolves to one) and is emitted inside `properties`, never at the top level.
131
150
  - Event/property names are lowercase snake_case, begin with a letter, and are at most 50 characters.
132
151
  - Target property names are unique and do not collide with UE system fields.
133
- - Types are one of `string`, `number`, `boolean`, `datetime`, `list`, or `object`.
152
+ - Types are one of `string`, `number`, `boolean`, `datetime`, `list`, `object`, or `array_row`.
134
153
  - Text is at most 2 KB; numbers stay within -9E15..9E15.
135
154
  - Lists contain at most 500 strings (255 bytes each) or 500 objects.
136
155
  - Objects contain at most 100 legal sub-properties; nested values follow the same type limits.
156
+ - No `object`/`array_row` survives into the tracking plan: AE requires each to have a `parent.child` sub-property (scalar or `array_string` only), and a mapping cannot express one, so nested objects/object-arrays are flattened to scalar leaves first (a kept-whole container fails `data-integration plan` fast).
137
157
  - A conversion rule does not hide a real type conflict.
138
158
  - Event/profile times fall within the receiver window: previous 3 years through next 3 days.
139
- - Do not fabricate UUIDs, identities, times, or events; `#ip`/`#uuid` map from named source columns only (`ip_field`/`uuid_field`).
159
+ - Do not fabricate UUIDs, identities, times, or events; `#ip`/`#uuid` map from named source columns only (`ip_field`/`uuid_field`). `#uuid` is never auto-generated.
160
+ - `#uuid` values are standard 36-character UUIDs and `#ip` values are valid IPv4/IPv6; invalid ones are dropped from the row only (`skipped_fields`), never quarantined.
161
+ - `#ip` and `#zone_offset` appear on `track` records only; user data carries neither.
140
162
  - `value_mapping`, `random_pool`, and fixed `account_id_value`/`distinct_id_value` came from an explicit user decision and match the actual distinct values/columns.
141
163
 
142
164
  `user_set` output for the same identity is ordered by time so receiver application order is deterministic. Conversion applies whole-row quarantine: any error on a row — identity, time, event, record type, or a single property (type coercion, size/limit) — drops the entire row. The row is written to `invalid.rows.jsonl` with its error codes, counted in `manifest.output.invalid_records`, and the manifest is blocked until reviewed. The failed rows are re-reportable without re-sending valid rows: fix the mapping, then run `convert --input-file <same-source> --mapping <fixed-mapping> --salvage-from <invalid.rows.jsonl>`. The salvage run re-processes only the listed row numbers against the same source, emits a `valid.ue.jsonl` containing only the newly fixed rows, and writes a new `invalid.rows.jsonl` with whatever still fails — so the loop repeats (feeding each round's `invalid.rows.jsonl` into the next `--salvage-from`) until no rows fail or the user stops.
@@ -229,6 +229,8 @@ When experiment mode is enabled (`context.enableExp=true` or draft `expConfig.en
229
229
  - capability `engage-task.task.build-save-guide` enriches `handoff.reqTemplate.channelConfig.groupContentList`
230
230
  so each entry carries `expGroupName`, `expGroupType`, `percentageInExperiment`, `order`, and `contentList`
231
231
  - do not drop those association fields when filling content; they must stay aligned with `expConfig.expGroupList`
232
+ - copy the complete group tuple (`expGroupName`, `expGroupType`, `percentageInExperiment`, `order`)
233
+ into both lists; matching only by list position is not sufficient
232
234
 
233
235
  ### 4.8 `fieldRules`
234
236
 
@@ -300,6 +302,11 @@ Apply this rule only to
300
302
  `completionIndicatorDef.completionIndicators[].eventDefinition.filters`. Trigger-event filters have
301
303
  their own scenario rules and are not subject to this completion-filter restriction.
302
304
 
305
+ For `completionIndicatorType=0`, also read and preserve `requiredMainGoalFields` and
306
+ `touchCycleRule`. A valid main goal includes `touch_cycle_num` and `touch_cycle_num_unit`; use `1`
307
+ and `day` when no custom completion window is requested. Do not rely on static `--validate` alone
308
+ because the save service performs this additional business validation.
309
+
303
310
  ### 4.9 `handoff`
304
311
 
305
312
  This is the final section before `save_task`.
@@ -336,6 +343,8 @@ Recommended usage pattern:
336
343
  definition directly
337
344
  7. omit `clientConfig.clientQp`; partial updates preserve the server-authored value
338
345
  8. call `engage-task task save`
346
+ 9. after an experiment save succeeds, call `engage-task task get` and verify that both
347
+ `exp_config.exp_group_list` and `group_content_list` contain the expected group tuples
339
348
 
340
349
  ---
341
350
 
@@ -426,6 +426,11 @@ When the guide points to event-based completion or experiment-driven main-goal r
426
426
  Read `fieldRules.blocks.controlConfig.completionIndicatorDef.filterPropertySelectTypes` and exclude
427
427
  every property type listed under `excluded` before constructing its `filters`.
428
428
 
429
+ For a main goal (`completionIndicatorType=0`), always include `touch_cycle_num` and
430
+ `touch_cycle_num_unit`. If the user does not request another completion window, use
431
+ `touch_cycle_num=1` and `touch_cycle_num_unit="day"`. Static Capability validation may accept a
432
+ main goal without these fields, but the Hermes save service rejects it.
433
+
429
434
  Important constraints that still apply:
430
435
 
431
436
  - `doNotDisturb.enableDoNotDisturb=true` requires `startTime` and `endTime` in `HH:mm`
@@ -444,6 +449,81 @@ compatibility field, and partial task updates preserve the existing server value
444
449
  client-side condition has no semantic field in the current contract, stop and report that it cannot
445
450
  be safely authored through this Capability.
446
451
 
452
+ ### 4.7 Verified A/B Task Template
453
+
454
+ Use this shape as the starting point for a server-channel split experiment. Replace every
455
+ placeholder with metadata discovered from the current project.
456
+
457
+ ```json
458
+ {
459
+ "baseInfo": {
460
+ "taskName": "<taskName>",
461
+ "taskDesc": "<taskDescription>",
462
+ "tzOffset": "<projectTimezoneOrDefaultSentinel>"
463
+ },
464
+ "channelConfig": {
465
+ "channelType": 1,
466
+ "channelId": "<verifiedChannelId>",
467
+ "groupContentList": [
468
+ {
469
+ "expGroupName": "Control",
470
+ "expGroupType": 1,
471
+ "percentageInExperiment": 50,
472
+ "order": 0,
473
+ "contentList": [{ "pushLanguageCode": "default", "content": "<channelContentJsonString>" }]
474
+ },
475
+ {
476
+ "expGroupName": "Experiment A",
477
+ "expGroupType": 2,
478
+ "percentageInExperiment": 50,
479
+ "order": 1,
480
+ "contentList": [{ "pushLanguageCode": "default", "content": "<channelContentJsonString>" }]
481
+ }
482
+ ]
483
+ },
484
+ "targetConfig": {
485
+ "targetClusterType": 1,
486
+ "definitionRequest": "<semanticAudienceDefinition>"
487
+ },
488
+ "triggerConfig": { "triggerType": 2 },
489
+ "controlConfig": {
490
+ "completionIndicatorDef": {
491
+ "completionIndicators": [
492
+ {
493
+ "completionIndicatorType": 0,
494
+ "touch_cycle_num": 1,
495
+ "touch_cycle_num_unit": "day",
496
+ "eventDefinition": {
497
+ "type": "event",
498
+ "event": "<verifiedGoalEvent>",
499
+ "aggregation": "count",
500
+ "operator": "gte",
501
+ "value": 1
502
+ }
503
+ }
504
+ ]
505
+ },
506
+ "frequencyLimits": { "enableFrequencyLimits": false, "ruleList": [] }
507
+ },
508
+ "expConfig": {
509
+ "enableExp": true,
510
+ "expType": 1,
511
+ "percentageInLayer": 100,
512
+ "expIndicatorBizType": 1,
513
+ "controlGroupSkipPush": false,
514
+ "expGroupList": [
515
+ { "expGroupName": "Control", "expGroupType": 1, "percentageInExperiment": 50, "order": 0 },
516
+ { "expGroupName": "Experiment A", "expGroupType": 2, "percentageInExperiment": 50, "order": 1 }
517
+ ]
518
+ }
519
+ }
520
+ ```
521
+
522
+ The experiment group tuple (`expGroupName`, `expGroupType`, `percentageInExperiment`, `order`)
523
+ must be identical between each `expConfig.expGroupList` entry and its corresponding
524
+ `channelConfig.groupContentList` entry. Validate the final request, save it, then call `task get`
525
+ and verify both persisted lists; a successful task ID alone is not sufficient verification.
526
+
447
527
  ---
448
528
 
449
529
  ## 5. Final Self-Check Before `engage-task task save`
@@ -461,6 +541,8 @@ Before submission, verify:
461
541
  9. No unsupported `triggerType=6` is used.
462
542
  10. Ordered steps contain `eventDefinition` and sequence metadata, not persisted aggregate fields.
463
543
  11. No placeholder IDs or fabricated resource names remain in the request.
544
+ 12. Every main goal includes `touch_cycle_num` and `touch_cycle_num_unit`.
545
+ 13. For experiments, `expGroupList` and `groupContentList` contain identical group tuples.
464
546
 
465
547
  ---
466
548
 
@@ -56,6 +56,7 @@ Naming and response boundary:
56
56
  - `experiment feature save`
57
57
  - `experiment metric save`
58
58
  3. Create or patch the experiment draft with `experiment experiment save`.
59
+ Use `experiment experiment update-metrics` when replacing metric bindings or assigning guardrail roles.
59
60
  4. Check readiness with `experiment experiment ready-check`.
60
61
  5. For a non-mutex traffic layer, run `experiment experiment conflict-check` before submit (needs `feature_key_list` from context or `experiment get`).
61
62
  6. Move status with `experiment experiment manage`.
@@ -66,6 +67,7 @@ If an experiment save returns `error_code: METRIC_NOT_FOUND`, list metrics for t
66
67
  ## Parameter Conventions
67
68
 
68
69
  - Experiment save payloads distinguish two allocation fields: experiment-level `req.allocation` (**integer only; no decimals**) and group-level `req.groups[].allocation` (**integer only; sum must equal `100` exactly**).
70
+ - Public experiment metric roles are `primary`, `secondary`, and `guardrail`. The internal `observation` role is currently unavailable for saves. Guardrail is a binding role; updating metrics replaces the full binding list.
69
71
 
70
72
  ```bash
71
73
  ae-cli experiment experiment get --project-id 1 --exp-id exp_123
@@ -92,7 +94,9 @@ Read [`save_build_guide.md`](references/save_build_guide.md) and
92
94
 
93
95
  ### Experiment
94
96
 
95
- `experiment experiment save`, `capability run experiment.experiment.save-submit`, `experiment experiment list`, `experiment experiment list-archived`, `experiment experiment get`, `experiment experiment ready-check`, `experiment experiment conflict-check`, `experiment experiment manage`, `experiment experiment update-group`, `experiment experiment batch-delete`, `experiment operation-log query`
97
+ `experiment experiment save`, `experiment experiment update-metrics`, `capability run experiment.experiment.save-submit`, `experiment experiment list`, `experiment experiment list-archived`, `experiment experiment get`, `experiment experiment ready-check`, `experiment experiment conflict-check`, `experiment experiment manage`, `experiment experiment update-group`, `experiment experiment batch-delete`, `experiment operation-log query`
98
+
99
+ Read [`manage_guardrail_metrics.md`](references/manage_guardrail_metrics.md) before assigning or replacing metric roles.
96
100
 
97
101
  ### Traffic Layer and Buckets
98
102
 
@@ -104,4 +108,6 @@ Read [`save_build_guide.md`](references/save_build_guide.md) and
104
108
 
105
109
  ### Metric and Feature
106
110
 
107
- `experiment metric save`, `experiment metric get`, `experiment metric list`, `experiment metric delete`, `experiment feature save`, `experiment feature update-status`, `experiment feature get`, `experiment feature list`, `experiment feature version-list`, `experiment feature operation-log query`, `experiment feature batch-delete`
111
+ `experiment metric save`, `experiment metric get`, `experiment metric list`, `experiment metric delete`, `experiment feature save`, `experiment feature update-status`, `experiment feature get`, `experiment feature list`, `experiment feature version-list`, `experiment feature operation-log query`, `experiment feature batch-delete`, `experiment feature whitelist list`, `experiment feature whitelist save`, `experiment feature whitelist update-status`, `experiment feature whitelist batch-delete`
112
+
113
+ Read [`manage_feature_whitelist.md`](references/manage_feature_whitelist.md) before querying or changing Feature whitelist rules.
@@ -0,0 +1,66 @@
1
+ # Feature Whitelist Rules
2
+
3
+ List, create, modify, enable, disable, or delete explicit Feature whitelist rules.
4
+
5
+ ## List
6
+
7
+ ```bash
8
+ ae-cli experiment feature whitelist list \
9
+ --project-id <id> --feature-key <feature_key>
10
+ ```
11
+
12
+ The result contains only explicit whitelist rules for the Feature. Each item exposes `rule_id`,
13
+ `feature_key`, `priority`, `status`, and a structured snake-case `whitelist` array. Use the returned
14
+ `rule_id` for modification, status changes, or deletion.
15
+
16
+ ## Save
17
+
18
+ ```bash
19
+ ae-cli experiment feature whitelist save \
20
+ --project-id <id> \
21
+ --feature-key <feature_key> \
22
+ --status enable \
23
+ --whitelist '[{"bucket_id":"#user_id","rules":[{"ids":["u1","u2"],"value":"on"}]}]'
24
+ ```
25
+
26
+ Pass `--rule-id` to modify an existing whitelist rule. Omit it to create a rule. The Hermes
27
+ Capability fixes the Atlas rule type to `targeting` and serializes the supplied buckets into the
28
+ server's explicit whitelist rule configuration.
29
+
30
+ Rules:
31
+
32
+ - Resolve the Feature with `experiment feature get` before writing.
33
+ - `bucket_id` is the split subject, such as `#user_id` or `#account_id`.
34
+ - Each bucket contains one or more rows with a non-empty `ids` array and a string `value`.
35
+ - An empty string Feature value is allowed. Bucket IDs cannot be empty or duplicated. IDs must be
36
+ unique within one bucket, while different buckets may use the same string ID.
37
+ - The server validates each value against the Feature type and limits the total ID count.
38
+ - Only one explicit whitelist rule can be enabled for the same Feature.
39
+ - Enabling, modifying, disabling, or deleting an enabled whitelist rule immediately creates a new
40
+ version and syncs RCC when the Feature itself is online.
41
+
42
+ ## Status
43
+
44
+ ```bash
45
+ ae-cli experiment feature whitelist update-status \
46
+ --project-id <id> --rule-id <rule_id> --status enable
47
+ ```
48
+
49
+ Valid status transitions exposed by this command are `enable` and `disable`.
50
+
51
+ ## Delete
52
+
53
+ ```bash
54
+ ae-cli experiment feature whitelist batch-delete \
55
+ --project-id <id> --rule-ids '["0001"]'
56
+ ```
57
+
58
+ Deletion is high risk and requires confirmation. Enabled whitelist rules may be deleted; Hermes
59
+ resynchronizes affected online Features afterward.
60
+
61
+ All four commands use Capability Gateway with CLI-token authentication:
62
+
63
+ - `experiment.feature_whitelist.list`
64
+ - `experiment.feature_whitelist.save`
65
+ - `experiment.feature_whitelist.update_status`
66
+ - `experiment.feature_whitelist.batch_delete`
@@ -0,0 +1,26 @@
1
+ # experiment experiment update-metrics
2
+
3
+ Replace the metric bindings of an existing experiment draft and assign metric roles, including
4
+ guardrail metrics.
5
+
6
+ ```bash
7
+ ae-cli experiment experiment update-metrics \
8
+ --project-id <id> \
9
+ --exp-id <exp_id> \
10
+ --metrics '[{"metricId":"conversion","metricRole":"primary"},{"metricId":"error_rate","metricRole":"guardrail"}]'
11
+ ```
12
+
13
+ ## Contract
14
+
15
+ - Discover every `metricId` with `experiment metric list`; never invent metric IDs.
16
+ - `--metrics` must be a non-empty array. Each item requires camelCase `metricId` and `metricRole`.
17
+ - `metricRole` is one of `primary`, `secondary`, or `guardrail`. Do not submit the internal
18
+ `observation` role; Hermes currently rejects it at save boundaries.
19
+ - This command replaces all saved metric bindings because Hermes treats a non-empty `metrics` list
20
+ in a draft patch as a replacement. Include bindings that must remain, not only the new guardrail.
21
+ - Guardrail is a binding role, not a separate metric type. Create the underlying metric first with
22
+ `experiment metric save` when it does not exist.
23
+ - At least one `primary` metric is still required before readiness succeeds.
24
+
25
+ Run with `--dry-run` first, then verify the persisted roles with `experiment experiment get` and
26
+ run `experiment experiment ready-check`.
@@ -104,7 +104,7 @@ ae-cli experiment experiment save --project-id 1 --req '{"expId":"exp_123","allo
104
104
  - `expCycle.cycleType` can be `day` or `sample`; when `cycleType=day`, `dayNum` is `1..90`. Blank cycle defaults to day + 30.
105
105
  - Before readiness, `groups` must be non-empty, contain exactly one control group (`isControl=1`), group allocations must sum to exactly `100`, and each `expGroupValue` must be a non-empty JSON string array.
106
106
  - Feature experiments must bind `featureKeyList` before readiness. `featureKeyList` contains Feature key strings, not Feature objects. The MCP currently supports one `featureKey` for feature experiments.
107
- - Metrics use `metricRole=primary|secondary|guardrail|observation`; before readiness at least one primary metric is required.
107
+ - Metrics use `metricRole=primary|secondary|guardrail`; the internal `observation` role is currently unavailable for saves. Before readiness at least one primary metric is required.
108
108
  - `targeting` replaces the saved targeting object when provided.
109
109
  - Custom audience QP must be supplied as the semantic object
110
110
  `targeting.definitionRequest`. Do not submit the internal `targeting.targetConfig`
@@ -97,7 +97,7 @@ ae-cli kb +url \
97
97
  --parse-instruction "Keep headings and code blocks"
98
98
  ```
99
99
 
100
- `--url` must be `http(s)`.
100
+ `--url` must be `http(s)`. The server detects the platform from the URL automatically: URLs on a `*.feishu.cn` or `*.larksuite.com` subdomain are parsed with the Feishu pipeline (including sub-documents, using the server's own Feishu parsing instruction — `--parse-instruction` is ignored for them); all other URLs are fetched as regular web pages.
101
101
 
102
102
  ### Generate Schema and Compile
103
103