Skip to content

feat: semantic metrics - #52

Merged
CITGuru merged 2 commits into
mainfrom
feat/semantic_metrics
Jul 17, 2026
Merged

CITGuru merged 2 commits into
mainfrom
feat/semantic_metrics

Conversation

@CITGuru

@CITGuru CITGuru commented Jul 17, 2026

Copy link
Copy Markdown
Owner
  • workspace-level semantic.metrics: composing measures into named metrics, queryable by dot-free name through the existing semantic query surface (CLI/MCP/gRPC, no wire change)
  • kinds: ratio (DOUBLE cast + NULLIF guard, cross-model via aggregate locality), derived ({member} expressions), cumulative (running_total / grain_to_date / trailing), offset (value/delta/growth via LAG), share (percent-of-partition)
  • window metrics join a dense time axis (generate_series, or a declared semantic.time_spine table) so results stay calendar-correct across gaps
  • governed filters at metric/operand/token level push down to leaf FILTER (WHERE) clauses; metric-over-metric with cycle detection
  • config validation: references, cycles, collisions, window time-dim and period checks; JSON schema regenerated
  • EngineError::from_wire: clients rebuild wire errors without re-prefixing (fixes doubled semantic plan error: / internal error: over gRPC/REST)
  • metrics examples in examples/semantic/; docs + changelog

Tests: 856 workspace tests pass (37 new: serde shapes, validator rules, SQL-shape, gapped-axis calendar correctness, end-to-end); all example try-it commands driven live with hand-checked values.

- workspace-level semantic.metrics: composing measures into named metrics,
  queryable by dot-free name through the existing semantic query surface
  (CLI/MCP/gRPC, no wire change)
- kinds: ratio (DOUBLE cast + NULLIF guard, cross-model via aggregate
  locality), derived ({member} expressions), cumulative (running_total /
  grain_to_date / trailing), offset (value/delta/growth via LAG), share
  (percent-of-partition)
- window metrics join a dense time axis (generate_series, or a declared
  semantic.time_spine table) so results stay calendar-correct across gaps
- governed filters at metric/operand/token level push down to leaf
  FILTER (WHERE) clauses; metric-over-metric with cycle detection
- config validation: references, cycles, collisions, window time-dim and
  period checks; JSON schema regenerated
- EngineError::from_wire: clients rebuild wire errors without re-prefixing
  (fixes doubled 'semantic plan error:' / 'internal error:' over gRPC/REST)
- metrics examples in examples/semantic/; docs + changelog
@vercel

vercel Bot commented Jul 17, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
pawrly Ready Ready Preview Jul 17, 2026 1:35am

Request Review

@CITGuru
CITGuru merged commit cd77ab5 into main Jul 17, 2026
5 checks passed

This branch was successfully deployed

1 active deployment
Preview — e4d912a1 Deployed Jul 17, 2026 by vercel[bot]
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