Skip to content

Interface: RuleEntryDto

@kortexya/reasoninglayer


@kortexya/reasoninglayer / RuleEntryDto

Defined in: src/types/inference.ts:1705

A single stored rule (clause with antecedents).

Both head and body are homoiconic PsiTermDto values (untagged feature-value representation).

optional aggregator?: RuleAggregatorDto

Defined in: src/types/inference.ts:1761

The head aggregator this rule declares, as STRUCTURE.

The descriptor is stored as a scaffolding feature on the head. The listing lifts it here exactly as it lifts RuleEntryDto.certainty, and the head’s features map omits the raw feature — so a caller reads the aggregation a rule performs without parsing a serialized blob out of a feature value.


body: PsiTermDto[]

Defined in: src/types/inference.ts:1711

The body (antecedents) of the rule.


optional certainty?: number | null

Defined in: src/types/inference.ts:1713

Optional certainty/confidence for the rule.


optional etag?: string

Defined in: src/types/inference.ts:1724

The rule’s content tag (sha256-<hex>): pass it as ifMatch to InferenceClient.deleteRule or InferenceClient.replaceRule.

The same tag those routes judge the precondition against. Present on a RuleEntryDto.withdrawable rule; absent on a rule no route withdraws, which has no mutation to precondition. getTerm(ruleId) does not serve it: a rule’s id answers 404 on the term route.


head: PsiTermDto

Defined in: src/types/inference.ts:1709

The head (consequent) of the rule.


optional notWithdrawable?: RuleNotWithdrawable

Defined in: src/types/inference.ts:1750

When RuleEntryDto.withdrawable is false, the refusal a withdrawal would produce — the same code and prose the mutation route answers with. Absent for a withdrawable rule.


origin: RuleOrigin

Defined in: src/types/inference.ts:1734

Where this rule came from, from the reading tenant’s point of view.

The listing deliberately returns the PLUGIN-MERGED rule set and admits the reserved system tenant’s rules, because they fire in every tenant’s proof — so three of the withdrawal route’s five refusal classes describe rules that appear here.


optional osfql?: string

Defined in: src/types/inference.ts:1771

The rule as OSFQL text, when it has a faithful spelling.

Absence is meaningful: the rule cannot be written in OSFQL today — an aggregator declared only on the JSON surface, or a carrier the renderer does not know. A UI should disable “edit as text” for that row rather than render a guess the engine would not parse back.


ruleId: string

Defined in: src/types/inference.ts:1707

Rule term ID (UUID).


withdrawable: boolean

Defined in: src/types/inference.ts:1744

Whether deleteRule / replaceRule will act on this rule rather than refuse.

Derived from the same walk the mutation routes run, so the listing and the refusal cannot disagree. The engine stays the authority: a caller may still be refused by a state change between this read and the write.