Skip to content

Interface: CounterfactualResponse

@kortexya/reasoninglayer


@kortexya/reasoninglayer / CounterfactualResponse

Defined in: src/types/causal.ts:251

Response for counterfactual query.

Evaluated under the canonical noisy-OR semantics of certainty-annotated causes/2 edges: causes(x, y, c) is read as an independent Bernoulli(c) transmission and effects are ORs of transmitted causes. The answer is exact relative to that declared parameterization — CounterfactualResponse.method names it. Declare a full SCM via CausalClient.scmCounterfactual for richer mechanisms.

assumedRootPriors: string[]

Defined in: src/types/causal.ts:256

Roots whose uninformative Bernoulli(1/2) prior entered the answer — recorded assumptions, never silent.


optional counterfactualValue?: unknown

Defined in: src/types/causal.ts:258

The counterfactual result (predicted value of consequent).


explanation: string

Defined in: src/types/causal.ts:260

Step-by-step explanation of the three-step algorithm.


method: string

Defined in: src/types/causal.ts:265

What actually ran: the declared semantics are named, and the answer is exact relative to them.


probabilityTrue: number

Defined in: src/types/causal.ts:270

P(consequent = true) in the counterfactual world, under the canonical noisy-OR semantics.


query: string

Defined in: src/types/causal.ts:272

The counterfactual query in natural language.


success: boolean

Defined in: src/types/causal.ts:274

Whether the counterfactual evaluation was successful.


trace: CounterfactualTraceDto

Defined in: src/types/causal.ts:276

Detailed trace of abduction, action, and prediction steps.