diagnose
Explain why a logical query holds, why it fails, or the missing facts that would make it true.
Instructions
Explain why a query holds, why it fails, or what would make it true.
Reach for this when reason returns something you did not expect. Modes:
why: the goal holds and you want the derivation.why_not: the goal fails and you want the missing facts or rules named. Reports predicates with no definition at all, then the deepest sub-goals that could not be proved.what_needs: the goal fails and you want the smallest set of facts that would make it true (bounded to 3 assumptions over base predicates).
Returns DiagnosisResult:
ok(bool): false when the request could not be evaluated.holds(bool): whether the goal currently holds.findings(list of str): observations, most actionable first.conclusion(str): a human-readable summary; forwhyit includes the rendered derivation.proof(object | null): the derivation tree, present when the goal holds.error(str | null): a readable message whenokis false.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| params | Yes |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| ok | Yes | False when the request could not be evaluated. | |
| error | No | Readable, actionable message when ok is False. | |
| holds | No | Whether the goal currently holds. | |
| proof | No | Derivation, present for `why` when the goal holds. | |
| findings | No | Observations: missing predicates, unprovable goals. | |
| conclusion | No | Human-readable summary of the diagnosis. |