Type Alias: OsfqlErrorType
@kortexya/reasoninglayer / OsfqlErrorType
Type Alias: OsfqlErrorType
Section titled “Type Alias: OsfqlErrorType”OsfqlErrorType =
"parse"|"compile"|"execution"|"row_cap"|"refused"|"boundary_needs_confirmation"|"lock_timeout"|"sort_governed_by_release"|"vocabulary_unavailable"|"forbidden"|"operational_authority_denied"|"operational_authority_undetermined"|"term_sort_unresolved"|"governed_sort_write_refused"|"authz_relation_derived"|"operational_rule_conclusion"|"authz_rule_shape"|"authz_parent_of_sort_refused"|"term_changed_concurrently"|string&object
Defined in: src/types/osfql.ts:1399
The class of an OSFQL failure, as POST /api/v1/osfql and
POST /api/v1/osfql/preview report it in error_type.
Remarks
Section titled “Remarks”-
parse(HTTP 400) — the program text does not parse. -
compile(HTTP 400) — it parses and does not compile. -
execution(HTTP 422) — it failed while running, including anALTER SORTwhose subject sort is unknown. A write refusal carries OsfqlRefusal beside it. ADROP SORT/ALTER SORT … PARENTSthat fails for a reason other than a refusal answers the status of its REST route. -
row_cap(HTTP 422) — one candidate-set materialisation outgrew the request’smaxRows. Nothing was written. Repair it with aLIMIT, a narrower pattern, or a largermaxRows. -
refused(HTTP 400 / 404 / 409) — a program refused before it ran because aDROP SORT/ALTER SORT … PARENTSis not alone (OsfqlFailure.atomicRefusal, HTTP 400); anALTER SORT … PARENTSnaming an unknown or foreign parent (HTTP 400); aDROP SORTthe guarded sort delete refused (sortDeleteRefusal); or a move the engine refused. -
lock_timeout(HTTP 503) — other writers kept the tenant’s knowledge base locked until the request deadline, and nothing ran. OnlyPOST /api/v1/osfqlanswers it (also before a read-onlyMATCH, when the ruleset rebuild cannot get the lattice in time); the preview never does. Retry it as is, or send a largertimeoutMs. -
sort_governed_by_release(HTTP 409) — the program declares, changes, moves or drops a sort the tenant’s active vocabulary release declares. Nothing of the program is kept. Change the sort through a governed vocabulary candidate; a new subsort and a lexical edit are admitted. -
vocabulary_unavailable(HTTP 503) — the sorts the active release governs could not be read, so no sort declaration write was admitted. Retry it. -
The authorization refusals of a mutation (reasoninglayer#1041), with the status and code the REST doors answer:
forbidden(HTTP 403) — Write, Delete or a model change is not granted, or the sort is reserved;operational_authority_denied(HTTP 403) — the operational authority proof is complete and admits no witness;operational_authority_undetermined(HTTP 403) — the proof neither found a witness nor completed;term_sort_unresolved(HTTP 403) — a delete of a term whose sort the tenant’s hierarchy does not hold;governed_sort_write_refused(HTTP 409) — a write onto a@governedsort; OsfqlRefusal carries the same code;authz_relation_derived(HTTP 409) — a write or retraction of acan/has_rolefact; OsfqlRefusal carries the same code;operational_rule_conclusion,authz_rule_shape,authz_parent_of_sort_refused(HTTP 422) — a rule or lattice statement that can never be legal.
An engine before #1041 answers each of them HTTP 422
execution(a governed write with its OsfqlRefusal); both are the same OsfqlError.
The type is open: an error_type the engine adds later is kept verbatim on
the error, with its refusal, rather than dropped to the bare status error.
An exhaustive switch needs a default.
timeout (HTTP 504) is not an OsfqlError: the SDK throws
DeadlineExceededError for it, the same class every other route’s
deadline throws.
Example
Section titled “Example”const kind: OsfqlErrorType = 'row_cap';