Type Alias: ConstraintViolationCode
@kortexya/reasoninglayer / ConstraintViolationCode
Type Alias: ConstraintViolationCode
Section titled “Type Alias: ConstraintViolationCode”ConstraintViolationCode =
"constraint_over_unread_data"|"dependants_exceed_commit_budget"|"dependant_not_writable"|"dependant_changed_concurrently"|"term_changed_concurrently"|"write_targets_derived_fact"|"write_targets_rule"
Defined in: src/types/terms.ts:702
The closed code a ConstraintViolationError carries
(ConstraintViolationError.code).
Remarks
Section titled “Remarks”constraint_over_unread_data— a bound constraint whose walk reads data the caller may not read (a feature that holds a term the caller’s Read grant does not show) refused the write (reasoninglayer#1230, #1235).POST /api/v1/terms,PUT /api/v1/terms/{id},POST /api/v1/terms/bulk,POST /api/v1/inference/factsandPOST /api/v1/actions/applyanswer it with one bare body:featureandconstraintare empty, and the message names nothing the caller was not shown. The constraint is still judged on the stored data. Nothing is written.dependants_exceed_commit_budget— the write would adjust more terms whose bound constraints read it than one commit can hold (reasoninglayer#1245). The message names the count and the budget;featureandconstraintare empty. Every counted dependant is one the caller may read. Nothing is written.dependant_not_writable— anupdatebound constraint of a term that reads the write would adjust that term, which the caller reads but may not write (reasoninglayer#1245, #1251).termIdnames that term;featureandconstraintare empty, and the message names the guard that refused it. Nothing is written.dependant_changed_concurrently— another writer changed a term whose bound constraint reads this write after the write judged it (reasoninglayer#1245, #1251). The body is the coded{ error, code, message, refs }:refs.dependantnames that term (read it witherrorBodyRefs), andtermIdisundefined. Nothing is written; retrying judges the term again.term_changed_concurrently— another writer changed a term the request read before its commit (reasoninglayer#1263). The body is the coded{ error, code, message, refs }:refs.termnames that term (read it witherrorBodyRefs). Nothing was written; reading again and retrying is safe. Every premised write answers it: term writes, review merge and correction, facet classification, ingestion, frame comments, app actions, page restore and UI generation.write_targets_derived_fact— the write targets a fact a rule derived; always aDerivedFactWriteError.write_targets_rule— the write targets a term of a rule; always aRuleTermWriteError.
Every other bound-constraint refusal carries no code and names its
feature and constraint: the written term’s own constraint, or the
constraint of a dependant over data the caller reads (#1245).
Example
Section titled “Example”const code: ConstraintViolationCode = 'constraint_over_unread_data';