Skip to content

Type Alias: TermWriteErrorCode

@kortexya/reasoninglayer


@kortexya/reasoninglayer / TermWriteErrorCode

TermWriteErrorCode = "write_creates_rule" | "governed_sort_write_refused"

Defined in: src/types/terms.ts:617

The code of a coded refusal that a term write door answers.

  • write_creates_rule (422) — the write carries a non-empty list under the feature when, which would make the term a RULE. Create a rule through client.inference (the rule routes) or OSFQL DERIVE. A scalar when is ordinary data.
  • governed_sort_write_refused (409) — the term’s sort is @governed, or descends from a governed sort: its terms are written and removed only by the engine, for every caller. POST, PUT, PATCH and DELETE on /api/v1/terms answer it, and so does a bulk retract with a governed member; nothing is applied.

Read either code with errorBodyCode(error). For write_creates_rule, POST /api/v1/terms, PUT /api/v1/terms/{id} and POST /api/v1/inference/facts answer an ApiError (status 422); a bulk write does not throw it: bulkCreateTerms names the row in BulkRefusedError.rows with feature: 'when', and bulkAddFacts lists the fact in rejected with the same message.

const code: TermWriteErrorCode = 'write_creates_rule';