Skip to content

Type Alias: SortCreateErrorCode

@kortexya/reasoninglayer


@kortexya/reasoninglayer / SortCreateErrorCode

SortCreateErrorCode = "sort_id_unavailable" | "sort_id_held_under_another_name" | "governed_sort_write_refused"

Defined in: src/types/sorts.ts:2051

The code of a 409 that POST /api/v1/sorts answers for a caller-chosen CreateSortRequest.id.

Read it with errorBodyCode(error) from a ConstraintViolationError.

  • sort_id_unavailable — the id is held outside the caller’s scope (by another tenant’s sort, or a shared-lattice id posted under a different name), or it is a name-based (version 5) UUID that names none of the caller’s own sorts. The message names only the id. Omit id to let the engine mint one. Every route that registers a sort answers this code.
  • sort_id_held_under_another_name — the id names one of the caller’s own sorts, and the request carries a different name. A re-post of an own id keeps the held name, so rename with PATCH /api/v1/sorts/{id}.
  • governed_sort_write_refused — the id names one of the caller’s own sorts that declares @governed, and the re-post omits the governed annotation, which would withdraw the fence. The same code refuses a PATCH that withdraws the annotation, a parent move that leaves a sort governed through an ancestor without a governed parent, and a terms=delete sort delete over terms of a governed sort.
const code: SortCreateErrorCode = 'sort_id_unavailable';