Repository navigation
feat(api): typed response structs, batch 9 — metrics, insights (#1199) - #1211
Merged
Merged
Conversation
…ty (#1199) The dashboard metrics, data quality, record quality, the insight series and per-source insights now return typed structs: read::Metrics, DataQuality/Completeness, Quality (an untagged oneOf of QualityReport and QualityUnconfigured, the two bodies the endpoint has always had), InsightPoint, SourceInsight, and the InsightSeries/SourceInsights envelopes. 5 more operations publish a $ref success schema (74 -> 79). er-api-spec: the envelope classifier now reads Json::<Name>(value) as the same unresolved scalar Json(value) is (pinned, and mutation-checked by deleting the condition). Without it a GET handler had to construct its response at the Json call to be typed at all, which these readers cannot do. Value equality against the previous json! builds is pinned in read.rs typed_detail_tests; envelopes.json is unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
marked this pull request as ready for review
November 24, 2026 17:19
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 24, 2026 17:28 — with
GitHub Actions
Inactive
This was referenced Nov 24, 2026
This branch was previously deployed
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.
Closes #1199
Part of #864 (batch 9 of 10: metrics+insights).
What
Batch 9 of #864 converts the dashboard metrics, data quality, record quality, the insight series and per-source insights to typed structs. 5 more operations now publish a
$refsuccess schema (74 → 79 of 119). One classifier change iner-api-spec:Json::<Name>(value)now reads as the same unresolved scalar thatJson(value)does.Why
OpenAPI is the customer integration contract (#857), and these are the numbers an integrator monitors.
Proof
make check: 1,157 passed, 0 failed.er-server --testsagainst Postgres: 391 passed.tsc --noEmitis clean against the regeneratedschema.d.ts.envelopes.jsonis unchanged.envelopes::tests::the_classifier_reads_each_form.Risk & rollback
Bodies are value-equal to the old ones.
/qualitykeeps its two bodies, now published as aoneOf. Rollback:git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-24T17:38:58Zmainis green with this change on it: merged3fb0124. The push runsrust45448961374 andfrontend45448961619, plusinfra,devcontainerandmarketing preview, all succeeded.imagesbuilt: run 45448961478, success.deployconverged: run 45449553294 succeeded withDEPLOY_SHA: d3fb0124…. Process proof, read 2026-11-25 after SSO was renewed: the live colour in dev (ci/web-api-blue) and prod (app/web-api-green) runser-api@sha256:e935e7e5…. ECR tags that digest8bd3c294(feat(api): self-service API keys — admin minting with a role ceiling, list, show-once UI (#866) #1216's merge), which contains this merge (d3fb0124) as an ancestor, and both pods logged"er-server listening","addr":"0.0.0.0:8000"at 08:11Z.driftandkindwere already red on schedule before feat(api): typed response structs, batch 3 — reviews+merges (#1193) #1202. The nightly golden-50k flake is scale golden (50k) fails deterministically on main since 03792063..ad38be23 (likely the DuckDB 2.0.1 bump) #1206.{}operations).typed-responses-864(the turbofish-over-variable classifier rule). Theapi-contractskill's line "neither classifier readsJson::<Name>(variable)" is now half-true; it gets corrected in #864 batch 11: type the 17 operations still publishing an empty {} success schema #1213.Specific to this change
Context — plan, discoveries, measurements, files
Plan
read::Metrics,DataQuality/Completeness,Quality(an untaggedQualityReport|QualityUnconfigured),InsightPoint,SourceInsight. Envelopes:InsightSeries,SourceInsights(run_id: nullwith no sources before any retained run).read.rs::typed_detail_tests.Discoveries
Json(m)), and the GET classifier rejectedJson::<Name>(m)with "no Json(...) found". A turbofish over a variable is exactly as unresolved asJson(m), so it now classifiesScalartoo. The ledger is unchanged, because the old form was alreadyScalar.Measurements
Files
rust/crates/er-api-spec/src/envelopes.rs,rust/crates/er-server/src/{read.rs,lib.rs,openapi.rs},frontend/src/lib/api/{openapi.json,openapi.public.json,schema.d.ts}