Skip to content

docs(analytics): add classifier dimensions/filters and response warnings#60

Open
jtcies wants to merge 2 commits into
mainfrom
devin/1782137129-sync-classifier-dimensions
Open

docs(analytics): add classifier dimensions/filters and response warnings#60
jtcies wants to merge 2 commits into
mainfrom
devin/1782137129-sync-classifier-dimensions

Conversation

@jtcies

@jtcies jtcies commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Summary

Syncs analytics skills with query builder changes landed since the last sync (2026-06-17). The main addition is the classifier dimensions/filters feature — classifier_dimensions and classifier_filters are new optional request fields on POST /api/v1/analytics/query that allow grouping by and filtering on dynamic, user-defined classification labels (topic, sentiment, category, etc.) from the generation_classifications table.

Key changes across three skill files:

  • openrouter-analytics-query: Full reference for both new request fields (classifier_dimensions, classifier_filters), including schema tables, constraints (31-day limit, operator restrictions), and column aliasing behavior. Also documents the new data.warnings response field for non-fatal filter resolution issues.
  • openrouter-analytics-schema: Adds a "Classifier Dimensions" section with question→query mapping examples. Updates constraints list with classifier limits.
  • openrouter-analytics: Adds classifier entries to the decision tree table.

Link to Devin session: https://openrouter.devinenterprise.com/sessions/2cb9ce3993bd43ffa3772ac9ebd18d5a
Requested by: @jtcies


Open in Devin Review

Sync skills with query builder changes since 2026-06-17:

- Document classifier_dimensions request field (group by dynamic
  classifier-produced labels like topic, sentiment, category)
- Document classifier_filters request field (filter on classifier
  dimension values with eq/neq/in/not_in)
- Document response warnings array for non-fatal filter issues
- Add classifier constraints to schema skill (max 10 each, 31-day limit)
- Add classifier entries to decision tree in main analytics skill

Co-Authored-By: Joseph Ciesielski <joseph.ciesielski@openrouter.ai>
@jtcies jtcies self-assigned this Jun 22, 2026
@devin-ai-integration

Copy link
Copy Markdown
Contributor
Original prompt from Joseph

# Daily Analytics Skills Sync

You are responsible for keeping the analytics skills in OpenRouterTeam/skills in sync with the analytics query builder in OpenRouterTeam/openrouter-web. Post your findings to the Slack channel #proj-activity-observability (C0AKMN11K7G).

#``# Step 1: Check for recent query builder changes

Clone both repos:

  • OpenRouterTeam/openrouter-web (query builder source of truth)
  • OpenRouterTeam/skills (analytics skills that document the query builder)

Check git log for the last 24 hours of changes in the query builder directory:

cd openrouter-web
git log --since="24 hours ago" --oneline -- packages/clickhouse/analytics/

Also check the analytics route handlers:

git log --since="24 hours ago" --oneline -- services/cfw-api/src/routes/analytics/

#``# Step 2: Read the current query builder state

Read these files to understand the current state of the query builder:

  • packages/clickhouse/analytics/schemas.ts — MetricNameSchema, DimensionNameSchema, Granularity, FilterOperator definitions
  • packages/clickhouse/analytics/metric-registry.ts — full metric definitions (name, displayLabel, availability, expressions, isRate, displayFormat)
  • packages/clickhouse/analytics/dimension-registry.ts — full dimension definitions (name, displayLabel, mvColumn, generationsColumn, availableIn, clickhouseType)
  • packages/clickhouse/analytics/operator-registry.ts — filter operator definitions
  • packages/clickhouse/analytics/table-resolver.ts — table resolution logic
  • packages/clickhouse/analytics/filter-builder.ts — filter building logic
  • packages/clickhouse/analytics/enrichment/ — label resolution (which dimensions get labels)
  • packages/clickhouse/analytics/trends/ — trends/leaderboard capabilities
  • services/cfw-api/src/routes/analytics/get-meta.ts — what the meta endpoint exposes

#``# Step 3: Read the current analytics skills

Read these skill files:

  • skills/openrouter-analytics/SKILL.md — main analytics ski... (2439 chars truncated...)

@devin-ai-integration

Copy link
Copy Markdown
Contributor

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR that start with 'DevinAI' or '@devin'.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Open in Devin Review

@perry-the-pr-maintainer perry-the-pr-maintainer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perry's Review

Adds full documentation for classifier_dimensions and classifier_filters request fields, the data.warnings response field, and related schema/decision-tree references across three analytics skill files.

Verdict: ✅ LGTM

Details

Risk: 🟢 Low — docs-only changes to three SKILL.md files; no executable code, no API changes

CI: no blocking failures ✅ (only the in-progress perry review check pending)

Findings (see inline comments for full context):

  • 🟡 skills/openrouter-analytics-query/SKILL.md:184 — response field table omits clf_dimension_name/clf_dimension_value key names

Security: no concerns — pure documentation, no credentials, no code paths touched

Test coverage: N/A — documentation changes

Unresolved threads: none

Review metadata

Scope: first review (full)

Review: tier=small · model=unknown · score=1.0

Comment thread skills/openrouter-analytics-query/SKILL.md
…table

Co-Authored-By: Joseph Ciesielski <joseph.ciesielski@openrouter.ai>

@perry-the-pr-maintainer perry-the-pr-maintainer Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Perry's Review

Adds classifier dimensions/filters documentation to three analytics skill SKILL.md files, and documents response warnings.

Verdict: ✅ LGTM

Details

Risk: 🟢 Low — docs-only changes

CI: all passing ✅

Findings (see inline comments for full context):

  • Prior suggestion at skills/openrouter-analytics-query/SKILL.md — resolved in this push

Security: no concerns — classifier_id ownership validated server-side per docs; no code touched

Test coverage: N/A — documentation only

Unresolved threads: none (prior suggestion addressed in e6e51c1)

Scope: incremental — 1 new line since prior review

Review: tier=small · model=claude-sonnet-latest · score=1.0

| Field | Description |
|---|---|
| `data.data` | Array of result rows. Each row has keys for requested metrics, dimensions, and `date__<granularity>` (when granularity is set, e.g. `date__day`, `date__hour`) |
| `data.data` | Array of result rows. Each row has keys for requested metrics, dimensions, and `date__<granularity>` (when granularity is set). For `classifier_dimensions` queries with a single `dimension_name`, a column is aliased to that name (e.g., `category`). With multiple names or no `dimension_names`, rows include `clf_dimension_name` and `clf_dimension_value` columns. |

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Prior suggestion resolved — the data.data row now documents both column shapes: single dimension_name → column aliased to that name (e.g. category); multiple names or omitted → generic clf_dimension_name / clf_dimension_value columns. This matches the detail already present in the Classifier Dimensions section.

Reviewed at e6e51c1

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