Conversation
…endpoints and rename `collection` pool to `scope`
|
This stack of pull requests is managed by Graphite. Learn more about stacking. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 5722ed7852
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| - schema: | ||
| type: string | ||
| in: path | ||
| name: scope{(@|%40)[^ |
There was a problem hiding this comment.
Use valid OpenAPI templates for scoped routes
The scoped route template is malformed: the inline regex in {scope{(@|%40)[^}/]+} is being interpreted as an extra path parameter, so the snapshot (and generated client) now require a bogus parameter named scope{(@|%40)[^. Any typed caller for the new scoped endpoints cannot call them with just { scope, name }, and interpolation will not produce the intended /v0/facets/@scope/name/... URL. Please keep the OpenAPI path as /v0/facets/{scope}/{name}/... and put the regex only on the scope parameter schema.
Useful? React with 👍 / 👎.
| description: Canonical facet name. For scoped facets use the literal-slash path | ||
| (`/@scope/name/...`) instead of encoding the slash. | ||
| schema: | ||
| type: string | ||
| pattern: ^(?:[a-z][a-z0-9-]*\/)?[a-z][a-z0-9-]*$ | ||
| pattern: ^[a-z][a-z0-9-]*[a-z0-9]$ |
There was a problem hiding this comment.
Route scoped facets off the unscoped name parameter
This contract now restricts {name} to unscoped names and says scoped facets must use the literal-slash routes, but the engine still resolves and downloads all registry facets through /v0/facets/{name}/{version} and /v0/facets/{name}/{version}/archive with the whole facet name as name in resolve-metadata.ts and download.ts. For a scoped facet such as @julian/cowsay (or the existing acme/cowsay parser form), the client will continue encoding the slash into the unscoped endpoint and get a registry 404/ownership error instead of hitting the new scoped route; split the scope/name and call the scoped paths when the name is scoped.
Useful? React with 👍 / 👎.
Merge activity
|

Why
The registry API has migrated from a "collections" model to a first-class "scopes" model. Scoped facets (e.g.
@julian/cowsay) now have dedicated routes rather than being addressed via encoded slashes, and the/v0/collectionsclaim endpoint has been removed in favor of scopes being created automatically at onboarding time.Details
Scoped facet routes added:
GET /v0/facets/@{scope}/{name}/latest-version— latest version pointer for a scoped facetGET /v0/facets/@{scope}/{name}/versions/{version}— full version listGET /v0/facets/@{scope}/{name}/{version}— version metadataGET /v0/facets/@{scope}/{name}/{version}/archive— 302 redirect to presigned S3 tarball URLGET /v0/facets/@{scope}/{name}/{version}/contents— verified resource bodiesGET /v0/facets/@{scope}— scope-root detail including owner identity and facet summaries (ScopeRootResponse)Collections removed:
POST /v0/collections(claim a collection) is gone. Scopes are now provisioned automatically when a user claims their username viaPOST /v0/onboarding/username, which now atomically creates the USERNAME reservation, PROFILE row, COGNITO_SUB reservation, and the user's@<username>scope. The onboarding route now also returns403 E_NAME_BLOCKEDfor reserved or blocked names.Error code changes:
E_COLLECTION_CLAIMEDandE_COLLECTION_NOT_OWNEDreplaced byE_SCOPE_NOT_FOUNDandE_SCOPE_NOT_OWNEDE_FACET_NOT_OWNEDaddedcollectiontoscopequeue_typeis now a constantglobal-facet(thecollection-claimvariant is removed)ClaimCollectionIdempotentandClaimCollectionSuccessschemas removedMigration run responses now include
createdanddeletedcounts.Unscoped facet name pattern updated to
^[a-z][a-z0-9-]*[a-z0-9]$(no longer allows encoded slash for namespacing); scoped facets must use the new literal-slash routes.Verification
CI