Interface: CounterfactualResponse
@kortexya/reasoninglayer / CounterfactualResponse
Interface: CounterfactualResponse
Section titled “Interface: CounterfactualResponse”Defined in: src/types/causal.ts:251
Response for counterfactual query.
Remarks
Section titled “Remarks”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.
Properties
Section titled “Properties”assumedRootPriors
Section titled “assumedRootPriors”assumedRootPriors:
string[]
Defined in: src/types/causal.ts:256
Roots whose uninformative Bernoulli(1/2) prior entered the answer —
recorded assumptions, never silent.
counterfactualValue?
Section titled “counterfactualValue?”
optionalcounterfactualValue?:unknown
Defined in: src/types/causal.ts:258
The counterfactual result (predicted value of consequent).
explanation
Section titled “explanation”explanation:
string
Defined in: src/types/causal.ts:260
Step-by-step explanation of the three-step algorithm.
method
Section titled “method”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
Section titled “probabilityTrue”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
Section titled “success”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.