Skip to content

Align profile search filters with the canonical envelope - #33

Merged
yosriady merged 1 commit into
mainfrom
claude/unify-filters-gi09rr
Jul 31, 2026
Merged

Align profile search filters with the canonical envelope#33
yosriady merged 1 commit into
mainfrom
claude/unify-filters-gi09rr

Conversation

@yosriady

@yosriady yosriady commented Jul 31, 2026

Copy link
Copy Markdown
Contributor

Ships alongside the API change in getformo/formono#2129 and the docs in getformo/docs.formo.so#125. Must land with them — the CLI currently builds requests the new API rejects.

Why

The API retired the identifier-in-path filter dialect. Resource identity now lives in named qualifiers (chain_id, app_id, token_address, tag_id, scope) alongside a stable field, and the old spellings return a 400.

The CLI was stale in three ways:

  • A documented example used --filters '[{"field":"chains.1.balance",...}]', which now 400s. These examples also feed SKILLS.md, so agents copy the broken form.
  • The --filters help text documented chains.{chain_id}.balance, apps.{app_id}.balance, tokens.{address}.balance with appId, and labels.{tag_id} — all retired. appId is rejected outright by the schema's .strict().
  • parseSearchFilters only validated the field prefix, so every retired shape passed client-side and failed server-side.

What changed

parseSearchFilters now mirrors the API schema: canonical fields only (users.{attribute} plus the four resource paths), per-field qualifier rules including app_id required iff scope: "protocol", numeric values on the .balance fields, and unknown properties rejected with a targeted hint for appIdapp_id. Retired paths get a message naming the fix rather than a generic parse error.

Also updated: the --filters describe text, the broken example (plus a new labels.value one), the command hint, and the three hand-maintained docs (README.md, SKILLS.md, skills/formo-analytics/SKILL.md) that documented the retired dialect.

Verification

pnpm typecheck, pnpm lint, and pnpm test (174 passing) all clean. New tests cover each retired spelling, the appId rejection, every required-qualifier rule, disallowed qualifiers, and the numeric-value rule.

🤖 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 API retired the identifier-in-path filter dialect: resource identity now
lives in named qualifiers (chain_id, app_id, token_address, tag_id, scope)
alongside a stable `field`, and the old spellings are rejected with a 400.

parseSearchFilters only validated the field *prefix*, so every retired shape
passed client-side and failed server-side. It now mirrors the API schema —
canonical fields only, per-field qualifier rules (including app_id required
iff scope is "protocol"), numeric values on the .balance fields, and unknown
properties rejected with a targeted hint for the retired `appId` spelling.

Also updates the --filters help text, the `chains.1.balance` example (which
would now 400), the command hint, and the three hand-maintained docs that
documented the retired dialect.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@chatgpt-codex-connector

Copy link
Copy Markdown

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, you can upgrade your account or add credits to your account and enable them for code reviews in your settings.

@yosriady
yosriady merged commit c477cec into main Jul 31, 2026
7 checks passed
@yosriady
yosriady deleted the claude/unify-filters-gi09rr branch July 31, 2026 08:32
yosriady added a commit that referenced this pull request Aug 3, 2026
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>
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