docs(analytics): sync analytics skills with query builder - #163
Conversation
Co-Authored-By: Joseph Ciesielski <joseph.ciesielski@openrouter.ai>
Original prompt from Joseph
|
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
Co-Authored-By: Joseph Ciesielski <joseph.ciesielski@openrouter.ai>
There was a problem hiding this comment.
Perry's Review
Verdict: ✅ LGTM
Risk: 🟢 Low
Details
Summary
Docs-only PR syncing three analytics skill files (openrouter-analytics, openrouter-analytics-query, openrouter-analytics-schema) with the query builder implementation in openrouter-web. No scripts changed, no behavior changes — purely documentation of drift found this week plus older gaps.
What's documented
include_unsetfilter flag (openrouter-web #32182) — optional boolean onin/not_infilters, valid only for dimensions with an unset bucket (api_key_id-1,app-1,userempty string). Consistently documented in both the query and schema skills.- Sentinel label resolutions —
api_key_id = -1→Chatroom,app = -1→Unknown, unresolved-workspace sentinelffffffff-ffff-ffff-ffff-ffffffffffff→Unattributed. Added to all three skill files. - Legacy all-zero UUID folding — workspace filtering/grouping by the account default workspace also covers activity recorded before workspace resolution existed. Documented consistently across all three files.
data_regiondimension —global/europe/us, generations-only (31-day limit). Added to schema skill's 31-day list, dimension categories, and query skill's timeout guidance.session_id31-day limit — added to schema skill's time range limits list.blended_cost_per_million_tokensmetric — total spend (incl. BYOK) per 1M tokens, NULL when no tokens. Added to schema skill's efficiency metrics and question-mapping table.
Consistency check
- Sentinel values (
Chatroom,Unknown,Unattributed) are consistent across all three files. - The
include_unsetsemantics (in adds unset rows, not_in excludes them, empty array withinmatches only unset) match between the query and schema skills. session_id's analytics representation (none) is correctly distinct from the raw generation metadata representation (nullinopenrouter-generationsskill) — no contradiction.data_regionis listed as 31-day in both the schema skill's time range limits and dimension categories, and added to the query skill's timeout guidance — consistent.
Risk assessment
Risk: 🟢 Low
Risk assessment:
| Dimension | Severity | Risk | Reasoning |
|---|---|---|---|
| Implementation risk | 🟩 | Low | Docs-only change with no code, scripts, or behavior changes; content is internally consistent and accurately documents existing API behavior. |
| Premise risk | 🟩 | Low | The PR's premise (sync docs with the query builder) is straightforward and the documented features are clearly stated with specific sentinel values and error messages. |
| Estimated impact | 🟩 | Low | Worst case: a docs inaccuracy misleads an agent or developer using these skills — no runtime, data, or security impact. |
| Risk Factor | Severity | Risk | Reasoning |
|---|---|---|---|
| Reversibility | 🟩 | Low | Markdown docs — trivially reverted. |
| Detectability | 🟩 | Low | Any inaccuracy would surface when a developer or agent tries the documented feature and it doesn't match. |
| Blast radius | 🟩 | Low | Only the three analytics skill files; no code paths affected. |
| Data integrity | None | No persisted state is touched. | |
| Financial exposure | None | No billing/payment code touched. | |
| Security and privacy exposure | None | No secrets, auth, or tenant-isolation paths touched. | |
| Propagation | 🟩 | Low | Downstream consumers of these skills (agents, developers) could be mildly misled, but no automated systems depend on the prose. |
| Availability | None | Docs-only; cannot affect serving. | |
| Recovery cost | 🟩 | Low | A docs fix is a one-line edit. |
| Time to correct | 🟩 | Low | Spotted immediately on first use of a documented feature. |
Summary
Weekly sync of the analytics skills against the query builder in
openrouter-web(packages/clickhouse/analytics/,services/cfw-public-api/src/routes/analytics/). Documents drift found this week plus older gaps still missing from the skills.New this week:
include_unsetfilter flag (openrouter-web #32182). Optional boolean, accepted only within/not_in, and only for dimensions that declare an unset sentinel:api_key_id(-1),app(-1),user(empty string). Anything else fails validation withDimension "<field>" has no unset bucket. The/metaresponse does not expose which dimensions have an unset bucket, so the skills now list them.Unattributedin results (openrouter-web #31529).workspacefiltering/grouping folds the legacy all-zero UUID into the account default workspace (openrouter-web #31855).Pre-existing gaps also fixed:
data_regiondimension (global/europe/us, generations-only so 31-day limit) was undocumented.session_idwas missing from the schema skill's 31-day dimension list.blended_cost_per_million_tokensmetric was undocumented.api_key_id = -1->Chatroomandapp = -1->Unknownwere undocumented.Docs-only, no scripts changed.
Note for reviewers: several older open sync PRs propose overlapping subsets of this content (#100, #112, #151, #152, #156, #157). This PR covers all of them for the analytics skills, so those can be closed once this lands.
Link to Devin session: https://openrouter.devinenterprise.com/sessions/2eda26fe458a45ba973b1a2be0528c14
Requested by: @jtcies