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" | "bound_constraint_over_engine_records"

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

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.
  • bound_constraint_over_engine_records — the request declares a bound constraint on a sort whose subtree holds a sort whose terms only the engine writes (a @governed or engine-authored sort, reasoninglayer#1249). The message names the constrained sort only. Declare the constraint on a sort below it that holds no such sort. The ontology imports (ontologyBridge.importOwl, importFoundry) answer the same code, and OSFQL CHECK ON answers it as refusal.code.
const code: SortCreateErrorCode = 'sort_id_unavailable';