Skip to content

Sync filter docs with the canonical envelope and cut 1.2.0 - #34

Merged
yosriady merged 1 commit into
mainfrom
chore/sync-canonical-filter-docs
Aug 3, 2026
Merged

Sync filter docs with the canonical envelope and cut 1.2.0#34
yosriady merged 1 commit into
mainfrom
chore/sync-canonical-filter-docs

Conversation

@yosriady

@yosriady yosriady commented Aug 3, 2026

Copy link
Copy Markdown
Contributor

Why

The CLI's filter code is already current with the API — commits #29#33 track P-2378 (#2108), P-2386 (#2125) and P-2387 (#2129), and openapi.json has not changed since 2026-07-31. The docs drifted in one place that matters.

contains was documented as "social fields only". Per packages/shared/constants/filterCapability.ts, the profiles surface supports it on routable string attributes (case-sensitive) and — new in P-2387 — on labels.value (case-insensitive). startsWith/endsWith were missing from the operator list entirely even though isCanonicalFilterOperator already accepted them, so anyone reading the help text would not know they exist.

What changed

  • Replace the one-line operator claim with the per-field support table the API enforces (src/commands/profiles.ts help text, README.md, SKILLS.md).
  • Document page_scope, added in P-2378 on kpis, top_*, revenue_* and volume_by_metric. It passes through --params today but was undocumented.
  • Note that the retired per-family analytics params (socials, chain_filters, app_filters, token_filters, label_filters, profile_filters, lifecycle_filter) are rejected with a 400 rather than silently ignored.
  • Bump to 1.2.0, covering the five unreleased canonical-envelope commits on top of v1.1.1. Minor rather than patch: the new validation rejects input the CLI previously forwarded.

No behaviour changes — documentation and the version field only.

Verification

pnpm build, pnpm lint and 174 unit tests pass.

Wire shapes were checked by running the built CLI against a recording server and diffing every request against openapi.json: profiles search (GET + {filters, logic} body with named qualifiers), analytics kpis/lifecycle/funnel/flow, segments create (filters, not filterSet), alerts create ({field, op, value}, not {name, operator}). All match.

Ten retired forms reject client-side: legacy operators, bare field names, chains.1.balance, appId, labels.value without tag_id, empty membership arrays, a literal | inside an array member, two-level nesting, the legacy alert envelope, and the legacy segment key.

⚠️ The 18 live-API integration tests did not runTEST_TOKEN is rejected by https://api.formo.so with HTTP 401, so they skip silently. They should be run against a fresh key before tagging v1.2.0.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

The `contains` operator is no longer social-only: the profiles surface
supports it on routable string attributes (case-sensitive) and, since
P-2387, on `labels.value` (case-insensitive). `startsWith`/`endsWith`
were missing from the CLI's operator list entirely even though the
validator already accepted them. Replace the one-line claim with the
per-field support table the API actually enforces.

Also document `page_scope` (new on kpis/top_*/revenue_*/volume_by_metric)
and note that the retired per-family analytics params are rejected with a
400 if pushed through `--params`.

Version 1.2.0 covers the five unreleased canonical-envelope commits
(#29#33) on top of v1.1.1.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@yosriady
yosriady merged commit 51fb186 into main Aug 3, 2026
7 checks passed
@yosriady
yosriady deleted the chore/sync-canonical-filter-docs branch August 3, 2026 02:37

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 05a737b430

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread README.md

On `kpis`, `top_*`, `revenue_*` and `volume_by_metric`, `--params '{"page_scope":"session"}'` widens a `page` filter from page-scoped metrics (the default) to the legacy session scope.

All user-attribute, profile, social, lifecycle and resource predicates go in the single `--filters` array, using the canonical envelope with named qualifiers (`chain_id`, `app_id`, `token_address`, `scope`, `tag_id`). The retired per-family params — `socials`, `chain_filters`, `app_filters`, `token_filters`, `label_filters`, `profile_filters`, `lifecycle_filter` — are rejected with a `400` if passed through `--params`.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Align analytics qualifier support with the CLI validator

When a user follows this guidance for a resource predicate, such as --filters '[{"field":"chains.balance","op":"gt","value":1,"chain_id":"1"}]', the command fails locally instead of reaching the API: validateAnalyticsFilter only permits field, op, value, and optional filters (src/commands/analytics.ts:61-82), so every named qualifier listed here is rejected as an extra key. Either teach the analytics validator to accept and validate these qualifiers or avoid documenting them as usable through this CLI.

Useful? React with 👍 / 👎.

Comment thread src/commands/profiles.ts
'contains works on routable string attributes (users.device, users.os, users.referrer, users.utm_*, users.click_id — case-sensitive), ' +
'on social fields and on labels.value (case-insensitive); ' +
'startsWith/endsWith are routable string attributes only; ' +
'notEmpty/isEmpty are value-less existence checks on string fields; ' +

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Qualify existence-operator support in profile help

When users consult profiles search --help for social or lifecycle string fields, this sentence advertises both existence operators even though the support table added by the same change says isEmpty is rejected for social fields and users.lifecycle accepts only eq and in (README.md:538-540). Following the generated CLI help therefore produces an API 400; list the actual eligible string field classes or explicitly say these operators apply only where supported.

Useful? React with 👍 / 👎.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant