Data Quality Service  ·  View 17 of 20  ·  Operations

Rules as Code

How an assertion gets from a pull request into the gate, and what can send it back.

Editable source SVG draw.io All views
Author Pull request rule DSL Lint + schema check pre-commit Compile Plan compiler must be bounded Cost estimate $ / run, posted to PR Gate Tier policy check may this block? Owner approval CODEOWNERS Publish Rule catalogue new assertion version Probation set advise for 30 days Prove Automatic backfill 30-day lookback Would-have-failed report posted to the PR thread Enforce Promote action advise → quarantine/block Live in the gate with FP tracking Watch FP rate monitor trailing 30 days Auto-demote > 5% → advise rework refused Rules as Code — From a Pull Request to an Enforcing Assertion Application we own Decision point Security / platform Data store Opportunity Risk / gap failure / alternate Nothing reaches the gate without having been run against history first. The would-have-failed report is the artefact that forces the discovery-or-bad-rule question to be answered by a person before enforcement. v 1.0 · owner Data Platform Architecture · date 2026-09

Decisions

  • Nothing reaches the gate without having been run against history first. The would-have-failed report is the artefact that forces the discovery-or-bad-rule question to be answered by a person (ADR-10).
  • The tier policy check can refuse a rule outright — an assertion declaring 'block' on a dataset whose tier does not permit blocking never merges (ADR-13).
  • The cost estimate is posted to the pull request, which puts the price in front of the reviewer rather than in next month's bill (ADR-08).

Assumptions

  • Git is the source of truth for the rule DSL; the catalogue is rebuildable from it.
  • CODEOWNERS provides owner approval; the review requirement is enforced by the repository, not by the service.

Risks

  • Two return paths — 'refused' and 'rework' — are where authors abandon rules. A high abandonment rate means the tier policy is miscalibrated, and it is worth measuring as a platform health signal, not just an author inconvenience.