Skip to content

Type Alias: OsfqlErrorType

@kortexya/reasoninglayer


@kortexya/reasoninglayer / 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.

  • 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 an ALTER SORT whose subject sort is unknown. A write refusal carries OsfqlRefusal beside it. A DROP SORT / ALTER SORT … PARENTS that 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’s maxRows. Nothing was written. Repair it with a LIMIT, a narrower pattern, or a larger maxRows.

  • refused (HTTP 400 / 404 / 409) — a program refused before it ran because a DROP SORT / ALTER SORT … PARENTS is not alone (OsfqlFailure.atomicRefusal, HTTP 400); an ALTER SORT … PARENTS naming an unknown or foreign parent (HTTP 400); a DROP SORT the 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. Only POST /api/v1/osfql answers it (also before a read-only MATCH, when the ruleset rebuild cannot get the lattice in time); the preview never does. Retry it as is, or send a larger timeoutMs.

  • 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 @governed sort; OsfqlRefusal carries the same code;
    • authz_relation_derived (HTTP 409) — a write or retraction of a can / has_role fact; 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.

const kind: OsfqlErrorType = 'row_cap';