Skip to content

Type Alias: TermRefusalCode

@kortexya/reasoninglayer


@kortexya/reasoninglayer / TermRefusalCode

TermRefusalCode = "term_has_referrers" | "term_named_by_rules" | "term_cascade_too_large" | "term_detach_refused" | "term_detach_failed" | "term_cascade_forbidden" | "term_detach_forbidden" | "fluent_append_only" | "write_targets_derived_fact" | "write_targets_rule" | string & object

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

The stable code of a term-lifecycle refusal (the engine’s TermRefusalResponse).

  • term_has_referrers — other terms reference it; re-issue with references: 'cascade' or 'detach' after showing them.
  • term_named_by_rules — a rule names it; withdraw the rule first. A rule’s own pattern or variable answers write_targets_rule instead.
  • term_cascade_too_large — the cascade exceeds the engine’s bound.
  • term_detach_refused / term_detach_failed — a detach could not drop a referring feature (refused by a declaration, or failed to write).
  • term_cascade_forbidden / term_detach_forbidden — the caller may not cascade into or detach from a referrer it cannot write.
  • fluent_append_only — a fluent is append-only.
  • write_targets_derived_fact — the term is a fact a rule derived; derivedBy names the rule and repairs the writes that would work.
  • write_targets_rule — the term is part of a rule (its conclusion template, an antecedent pattern, a variable, or a ground sub-term that rule authoring minted inside one); ruleIds names them and repairs carries replace_rule and withdraw_rule (thrown as a RuleTermWriteError).

The engine can add a code, so any other string is admitted.