Rule Groups
Status: in preview (#640). Rule Groups are the MeasuredCloud core-model tier-1 runnable unit and ship alongside Checkpoints and Rule Suites today — both navigation entries stay until the cutover (#642) makes Rule Groups the canonical authoring surface. Agent-mode datasources are not runnable as group members yet (#688).
A rule group is a set of asset-scoped rule suites that span multiple data assets, run together as one job, and carry a health score. It is the unit that replaces the Checkpoint: a rule already knows its asset, and a group already knows its rules, so a group is directly runnable — manually with Run now today (schedule and alert binding land in a later unit).
Data model
RuleGroup lives in the per-tenant schema.
| Column | What it stores |
|---|---|
name / description | Human label + optional summary. |
tags | Free-form catalog tags. |
health_score | A 0–100 weighted pass-rate of the latest run, blended with history. NULL until a run actually evaluates expectations. |
health_computed_at | When the score was last recomputed. NULL if the group has never produced a score (e.g. every run so far errored before evaluating any expectation). |
last_run_at (read-only) | Timestamp of the group's most-recent run, derived from the newest parent-rollup result. This is distinct from health_computed_at: a run that only errored finalises a last_run_at but no score, so a group with failed runs still shows a real Last run instead of "Not yet run". NULL only when the group has never run. |
A RuleGroupMember join row attaches one asset-scoped RuleSuite (which carries its own data_asset_id) to the group, optionally narrowed to a BatchDefinition. A group spanning suites for assets A, B, C is therefore "rules across multiple assets".
Operations you can do
- Create / edit / delete —
Rule Groups → New rule group(UI) or thePOST/PATCH/DELETE /api/v2/.../rule-groupsendpoints. Deleting a group removes its members and deletes its run history (the group owns its results, so the group-run result rows — and their per-asset children — are deleted with it), then returns204. This is the #722 referential-integrity policy; it reverses the earlier behavior where a group's results were detached (rule_group_idset to null) and preserved. A group referenced by a schedule or an alert is still deletable: only the link to the group is removed — the schedule / alert itself survives, no longer pointing at the deleted group. - Manage members — add or remove asset-scoped rule suites on the group detail page. Each member resolves to its asset, linked from the members table.
- Run now —
POST /api/v2/.../rule-groups/{id}/runfans out into one per-asset run per runnable member and returns202. Running is read-only on your source: it reads your data and records results, changing nothing in the source. A group whose members include an agent-mode datasource is rejected (422) for now — run those assets via their checkpoint until agent-mode group support lands (#688). A group with members but no runnable member — every member's suite is not asset-scoped (data_asset_idis null, e.g. a legacy/shared suite or a member the cutover backfill left un-homed) — is rejected (409) rather than dispatching a run that would validate nothing: attach each suite to an asset (re-home or re-bind it) before running. An entirely empty group (no members) is a400. - Review run history — the group detail page lists the group-level rollup result per run, expandable into its per-asset child results.
Health score
The score is the weighted pass-rate of the group's most-recent run, blended with a short recency-decayed trend so a single flaky run doesn't swing the badge. It is recomputed at the end of every group run that evaluates at least one expectation. The list and detail pages render it as a color-graded badge: green (≥ 90), amber (70–89), red (< 70), and a grey "—" until a run produces a score.
A run that errors out before evaluating any expectation (for example, the datasource is unreachable) finalises a result and updates Last run, but leaves the health score untouched so an infra blip never zeroes a previously-healthy group. In that state the badge stays grey while the detail page's Health card reads "Last run … — no health score yet" rather than "Not yet run".