Deprecate types and mark draft version roots
Types in the type registry now have a lifecycle. A type can be deprecated with a sunset date, a message and a replacement, and a namespace says whether its version root is stable or still a draft. Both are on the Primitives and Type registry REST APIs.
- Deprecate a type.
POST /v1/primitives/{tenant}/{id}/deprecatemarks a type as one to stop using. The body is optional:sunset_date(YYYY-MM-DD, today or later),messageandreplacement_id. Calling it again changes those details. - It is a marker, not a lock. A deprecated type still resolves and validates, its bindings are unchanged and its JSON Schema is not modified. Nothing breaks on the sunset date.
- Restore it.
DELETE /v1/primitives/{tenant}/{id}/deprecateclears the deprecation. - Read it anywhere. Every type carries
deprecated,deprecated_at,sunset_date,deprecation_messageandreplacement_id; a single type also returnsreplacementwith the replacement's name and$id. - Draft version roots. A namespace has a
root_statusofstable(the default) ordraft. Create the next version's namespace as a draft, then set it tostablewhen it is ready.GET /v1/types/{tenant}/namespaces?root_status=draftlists draft roots apart from stable ones. - Audited. Deprecating and restoring are recorded as
primitive.deprecateandprimitive.restorein the registry audit log.
Core system types cannot be deprecated, and system namespaces are always stable.
In the app, Deprecate and Restore are on a type's page and Root status is on the Namespaces & scopes tab — see Deprecate a type and Version roots.
