docs(api): join on natural keys, demote surrogate id (TRA-891)#204
Merged
Conversation
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…-891) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
🚀 Preview Deployment Update ✅ This PR has been successfully merged into the preview branch. The preview environment will update shortly at: https://docs.preview.trakrf.id |
Deploying docs with
|
| Latest commit: |
85aeacb
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://e8a5c53b.docs-4n7.pages.dev |
| Branch Preview URL: | https://preview.docs-4n7.pages.dev |
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.
What
Corrects the TRA-885 advice that integrators should use the surrogate
idas their durable foreign key. Reframesidas a stable internal reconciliation anchor (not a business key), adds natural-key join guidance, and demotesidon the versioning page.Changes (docs-only)
resource-identifiers.md— removed "Useidas your durable foreign key when you mirror TrakRF data." (the one actively-wrong, dependency-inducing published line). Reframedidas an internal anchor + added a "Joining your system of record" subsection: assets/locations join onexternal_key; general rule = natural key where one exists, elseidas a reconciliation handle.changelog.md— reworded the TRA-885 entry to drop the FK prescription (kept the global-uniqueness/opaque facts).versioning.md— added anid-demotion note. Deliberately did not publish an absoluteid-permanence guarantee (that would re-sell the dependency this ticket removes).Prerequisite verification (against live
app.preview.trakrf.id/api/openapi.yaml)external_keyis present andrequiredon bothAssetViewandLocationView(ticket flagged locations as "unconfirmed" — now confirmed). ✓customer_identifierdoes not exist on the API — the field isexternal_key; docs keep that name.The ticket lists per-entity join guidance for users (email→id) and organizations (slug→id). Verification shows neither is a public joinable resource:
/users/*are internal-only, there's no publicUserschema, and the only public org endpoint is the singleton/orgs/me({id, name, scopes, api_key_id}— noslug). Per the ticket's own rule ("do not document a join key that is not present"), I omitted the user/org email/slug guidance rather than publishing aspiration, and instead stated the general rule + a note that users/org-admin aren't public joinable resources in v1. If you want those documented anyway (e.g. as roadmap), say so and I'll adjust.Validation
pnpm buildpasses — no broken-link/anchor warnings (the new#joining-your-system-of-recordcross-links from resource-identifiers.md and versioning.md resolve).docs/api/*exist onmainand are untouched here).Spec:
superpowers/specs/2026-05-30-tra-891-api-identity-join-guidance-design.mdPlan:
superpowers/plans/2026-05-30-tra-891-api-identity-join-guidance.md🤖 Generated with Claude Code