Skip to content

fix(segment): correct behavior condition docs and add CDP API pitfall guidance #110

Open

Description

@doryokujin

Summary

Multiple documentation errors and missing guidance in the segment and validate-segment skills cause users to write invalid YAML that passes local validation but fails on tdx sg push.

Problems Found

1. type: Behavior is display-only — API requires type: Value

The skill says type: Behavior but the CDP API only accepts type: Value with source/aggregation/filter. Local tdx validator accepts Behavior (it auto-converts on push), but tdx sg push --dry-run fails with server-side YAML validation error.

Current (wrong):
```yaml

  • type: Behavior
    attribute: purchase_event
    source: behavior_purchase_history
    ```

Correct:
```yaml

  • type: Value
    attribute: ""
    source: behavior_purchase_history
    aggregation:
    type: Count
    filter:
    type: And
    conditions:
    - type: Column
    column: some_column
    operator: { type: Equal, value: 1 }
    ```

2. Behavior filter requires `type: Column`, not `type: Value`

Skill shows `type: Value` inside filter conditions. API rejects this with `INVALID_RULE_TYPE - expected "Column"`. Must use `type: Column` with `column` field (not `attribute`).

3. Behavior source requires filter (BEHAVIOR_SOURCE_MISSING_FILTER)

Skill shows filter as optional. Without filter, the source is ignored and query runs against master table.

4. Nested condition depth limit undocumented (NESTED_CONDITION_GROUP)

Only 1 level of nesting allowed (And inside Or, or Or inside And). No And inside And-inside-Or.

5. Segment references need internal IDs

`include`/`exclude` segment references require TD-generated internal IDs (from `tdx sg pull`). Manual segment names/slugs don't resolve.

6. `--dry-run` validates all files without path arg

`tdx sg push --dry-run` processes all YAML files. Must specify file path to validate a single file.

Files to Update

  • `tdx-skills/segment/SKILL.md`
  • `tdx-skills/validate-segment/SKILL.md`

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions