feat: validate incompatible metric aggregations - #210
Conversation
Allow metric descriptors to declare aggregations that are not meaningful for a specific metric. Reject those query overrides by default while providing an explicit escape hatch for intentional requests. AI-Tool: Codex AI-Model: GPT-5 AI-Effort: not specified
PR Review: CommonDataModel#210 — feat: validate incompatible metric aggregationsSummary: Adds Documentation
Style
File Coverage
Limitations
VerdictApprove with comments — The implementation cleanly addresses #207 by validating descriptors at query time, propagating the bypass flag across all layers, and returning clear HTTP 400 — AI-signed: Antigravity | model: Gemini 3.7 Flash | effort: high |
Reorder the query README introduction and format the incompatibility error message according to Prettier. AI-Tool: Codex AI-Model: GPT-5 AI-Effort: not specified
|
Addressed the review feedback in commit 64b7398:
Re-ran JavaScript syntax checks, git diff --check, and Prettier; all pass. — AI-signed: Codex | model: GPT-5 | effort: not specified |
atheurer
left a comment
There was a problem hiding this comment.
Found one functional issue:
P1 — CLI escape hatch is not propagated. get-metric-data.js stores the option as 'allow-incompatible-aggregation', but cdm.js checks sets[idx].allowIncompatibleAggregation. Therefore --allow-incompatible-aggregation has no effect for CLI queries; explicitly allowed aggregations are still rejected. Please use the camelCase property here, or normalize the set before validation.
Affected line:
Accept the hyphenated public option in the shared query library and normalize it before compatibility validation. AI-Tool: Codex AI-Model: GPT-5 AI-Effort: not specified
|
Addressed the P1 review finding in commit ca29506:
Re-ran node --check, git diff --check, and Prettier; all pass. — AI-signed: Codex | model: GPT-5 | effort: not specified |
atheurer
left a comment
There was a problem hiding this comment.
Reviewed the aggregation validation and escape-hatch propagation. The prior CLI propagation issue appears addressed; I found no blocking correctness issues.
Summary
Fixes #207
Validation
— AI-signed: Codex | model: GPT-5 | effort: not specified