Repository navigation
feat(api): typed response structs, batch 4 — golden records+lineage (#1194) - #1205
Merged
Merged
Conversation
… entity links (#1194) The golden-record detail, records-by-key, every per-record steward action (suppress/protect/delete/verify and their retractions, unmatch), the JSON and CSV deliveries, and the entity-link endpoints now return Serialize + ToSchema structs: 16 more operations publish a $ref success schema (29 -> 45). The golden list stays an Arrow stream. entity_detail is typed first. PersonGolden/AccountGolden behind an untagged GoldenRow (a oneOf), LineageItem, EntityMember (row + the protected/verified flags) and EntityEventItem are spelled out with exhaustive destructuring From impls (item_from_row!). The write-back task serializes the same typed parts, so its plan JSON is unchanged. RecordsByKey.items stays Value: its keys are the dataset entity type's standardized columns. create_entity_link used to serialize rows.first(), so an empty RETURNING would have been a 201 with a null body. It is now a 500 naming the impossible case. Co-Authored-By: Claude Opus 5.5 <[email protected]>
acct_read asserted on the Value entity_detail used to return. It now serializes the GoldenDetail the endpoint serves and keeps the same assertions. (The /docs mobile overview baseline was regenerated in the pinned image for this branch and came out byte-identical, so it is unchanged here.) Co-Authored-By: Claude Opus 5.5 <[email protected]>
…ef (#1194) The test pinned the inline envelope ('properties.delivery_id') that the untyped json! produced. Typing the delivery deliberately replaced it with a reference, so the assertion follows the reference. Co-Authored-By: Claude Opus 5.5 <[email protected]>
athvin
marked this pull request as ready for review
November 24, 2026 15:36
Contributor
|
The marketing preview was removed because this PR is closed or merged. |
athvin
temporarily deployed
to
marketing-preview
November 24, 2026 15:45 — 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 #1194
Part of #864 (batch 4 of 10: golden records+lineage).
What
Batch 4 of #864 converts the golden-record detail, records-by-key, every per-record steward action (including unmatch), the JSON and CSV deliveries, and the entity links to typed structs. 16 more operations now publish a
$refsuccess schema (29 → 45 of 119). The golden list stays an Arrow stream.Why
OpenAPI is the customer integration contract (#857), and golden-record detail is the core result read.
Proof
make check: 1,152 passed, 0 failed.er-server --testsagainst Postgres: 386 passed.tsc --noEmitis clean against the regeneratedschema.d.ts.envelopes.jsonis unchanged.Risk & rollback
Bodies are value-equal to the old ones; only key order changes. One response changes in an impossible case:
create_entity_linkwith an emptyRETURNINGis now a 500 naming that case, where it used to be a 201 with anullbody. Rollback:git revert <merge-sha>.Post-merge ledger
Closed by: agent · session
Claude Code:d1e3b2dc-3174-4091-9c30-c08fc4820306onMac· 2026-11-24T16:07:59Zmainis green with this change on it: mergee38f2860. The push runsrust45429143432,frontend45429143787,infraanddevcontainerall succeeded.imagesbuilt: run 45429143124, success.deployconverged: run 45429987989 succeeded withDEPLOY_SHA: e38f2860…. 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 (e38f2860) as an ancestor, and both pods logged"er-server listening","addr":"0.0.0.0:8000"at 08:11Z.driftandkindwere already failing on schedule before this merge (03792063,3d7b8c36). The nightly golden-50k flake is scale golden (50k) fails deterministically on main since 03792063..ad38be23 (likely the DuckDB 2.0.1 bump) #1206.typed-responses-864(lake rows are projections, so spell out the items;pub(crate)response structs are rejected by the field parser). Theapi-contractskill's typed-items rule from feat(api): typed response structs, batch 3 — reviews+merges (#1193) #1202 already covers the rest.Specific to this change
Context — plan, discoveries, measurements, files
Plan
read::entity_detail.PersonGoldenandAccountGoldensit behind an untaggedGoldenRow, which publishes as aoneOf. Alongside them:LineageItem(both lineage rows),EntityMember(the row plusprotected/verified) andEntityEventItem. Each is spelled out throughitem_from_row!, an exhaustive destructure.GoldenDetail,RecordsByKey,StagedRecords/StagedRecordsApplied,UnmatchStaged/UnmatchApplied,DeliveryAccepted,EntityLinkList,EntityLinkDeleted, andEntityLinkWirefor create.read.rs::typed_detail_tests(3), plus one more inresponse_shape_tests.Discoveries
by_idandby_entityrows are projections, not the entities.GoldenRecordWirecarriesassembled_at,created_atandupdated_at, which the row lacks, so the registered entity wires cannot describe the detail. The items are spelled out.dags/tasks.rs's write-back also readsentity_detail. It serializes the same typed parts, so its plan JSON is unchanged.envelopesfield parser rejects apub(crate) struct, so response structs stay private.openapi::tests::upload_optional_body_and_delegated_write_are_describedpinned the inlinedelivery_idproperty. It now follows the$ref.RecordsByKey.itemsstaysValue: its keys are the dataset entity type's standardized columns.Measurements
Files
rust/crates/er-server/src/{read.rs,lib.rs,openapi.rs,dags/tasks.rs},rust/crates/er-server/tests/acct_read.rs,frontend/src/lib/api/{openapi.json,openapi.public.json,schema.d.ts}