Skip to content

Interface: RuleEntryDto

@kortexya/reasoninglayer


@kortexya/reasoninglayer / RuleEntryDto

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

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:1494

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:1444

The body (antecedents) of the rule.


optional certainty?: number | null

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

Optional certainty/confidence for the rule.


optional etag?: string

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

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:1442

The head (consequent) of the rule.


optional notWithdrawable?: RuleNotWithdrawable

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

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:1467

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:1504

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:1440

Rule term ID (UUID).


withdrawable: boolean

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

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.