Repository navigation
feat!: read checks through the control API - #1315
Merged
Merged
Conversation
People can list a target's checks with their newest results, read one check's recent results, and, with view.sql, read its SQL. Checks are keyed by binding_key, now a typed, indexed column on the audit-result mirror, because one audit name such as not_null covers many models and columns. A model rename or a severity or threshold change starts a new check history, and the old one stays readable. SQL reads are audited like node SQL. BREAKING CHANGE: control stores created by 0.188.x are not upgraded. The server refuses them with an error saying to recreate the control store; create a new one when upgrading.
kvlonge
enabled auto-merge (squash)
November 6, 2026 03:00
kvlonge
disabled auto-merge
November 6, 2026 03:02
kvlonge
enabled auto-merge (squash)
November 6, 2026 03:05
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
The control UI needs to list checks, their recent results and their SQL. The audit-result mirror holds every field, but nothing read it, and its only typed identity,
audit_name, is not unique: one generic audit such asnot_nullcovers many models and columns. In a playground build, 30 checks shared 9 audit names.Changes
binding_key, now a typed, indexed mirror column filled on ingestion.binding_keycovers the audit name, model, column, severity, run scope and thresholds, so a model rename or a severity or threshold change starts a new check history; the old history stays readable under its own key.GET /api/control/locations/{location}/targets/{target}/checksreturns the newest result of every check.GET …/checks/{binding_key}returns one check's results, newest first (limit, default 50). Both needviewon the whole target, like the catalog, and never return SQL, error texts (database errors quote the SQL) or evidence rows.GET …/checks/{binding_key}/sqlreturns the latest result's SQL and error texts. It needsview.sqlon the check's model (or the whole target for a check without one) and writes asql.readaudit entry, like node SQL. A denial is audited and returns 403; its reason names the check's node, a known low risk.Verification
sql.readaudit holding no SQL; other targets are refused. Keying byaudit_namefails it.cargo test -p sqlbuild-orchestration, client check and test, publication tests,make check-ci.