Skip to content

Interface: DerivedFactRepair

@kortexya/reasoninglayer


@kortexya/reasoninglayer / DerivedFactRepair

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

One write the engine proposes instead of a refused write onto a derived fact or onto a rule’s own term.

Carried by DerivedFactWriteError.repairs (a write onto a fact a rule DERIVED) and RuleTermWriteError.repairs (a write onto a term that is part of a rule). The wire shape is the engine’s OsfqlRepairDto, the same repair an OSFQL refusal of the same code carries.

kind: string

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

The repair family. On a write onto a derived fact the engine sends retract_premise or update_premise (write an asserted premise instead) and withdraw_rule (withdraw the rule that derived it, with its derivations). On a write onto a rule’s own term it sends replace_rule (replace the rule through PUT /api/v1/inference/rules/{id}) and withdraw_rule, one pair per rule the caller may edit; a plugin, system or bootstrap rule gets no repairs. A free string on the wire, so read unknown values as “no automatic repair”.


rewrite: string

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

A pasteable rewrite, with … holes to fill. A premise repair is an OSFQL statement (RETRACT person(name: "Ann");); a withdraw_rule or replace_rule repair names the REST route (DELETE /api/v1/inference/rules/{id}?derivations=retract, PUT /api/v1/inference/rules/{id}), because OSFQL has no statement that withdraws or replaces a rule.


optional target?: string

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

The term the repair acts on: the premise, or the rule.