Type Alias: FeatureValueDto
@kortexya/reasoninglayer / FeatureValueDto
Type Alias: FeatureValueDto
Section titled “Type Alias: FeatureValueDto”FeatureValueDto =
VariableFeatureValue|LiteralFeatureValue|InlineTermFeatureValue|SortRefFeatureValue|TermRefFeatureValue|string|number|boolean|null|FeatureValueDto[]
Defined in: src/types/values.ts:775
Untagged value type used by homoiconic inference endpoints.
Remarks
Section titled “Remarks”Serialization format: Untagged (raw JSON primitives).
Produces raw JSON values: "hello", 42, true, null, ["uuid1", "uuid2"].
Used by: backward chaining, forward chaining, and other homoiconic inference endpoints.
Do NOT use with term CRUD or query endpoints — use ValueDto instead.
The backend Rust type is FeatureValueDto in dto/homoiconic.rs with
#[serde(untagged)]. Variant ordering — load-bearing, because an
untagged union tries its variants in declaration order and an object with
extra keys still matches an earlier variant that ignores them:
- Variable (
{term_id, var_name}) - Literal (
{term_id, literal}) - Term (a whole wire Ψ-term
{term_id, sort_id, sort_name, features, display}) - SortRef (
{sort_ref, sort_name?}) - TermRef (
{term_id}) - TermRefs/List (array of FeatureValueDto)
- String
- Integer (i64)
- Real (f64)
- Boolean
- Null (uninstantiated)
A sort named as a value (domain Value::SortId) used to arrive as a bare
TermRefFeatureValue carrying the sort’s id, which GET /terms/{id}
answered 404 for. It now arrives as a SortRefFeatureValue.
Values arrive exactly as the engine sends them (snake_case keys). To send a
listed value back on a write — rebuilding a rule from getRules() — convert
it with featureValueToInput().
Ambiguity note: UUID strings and regular strings are both string in TypeScript.
The backend distinguishes them by UUID format. The SDK provides
discriminateFeatureValue() in utils/discrimination.ts for response parsing.