api-mutating-ops-use-before-after-diffing

IN premise

Mutating operations (`retract_node`, `assert_node`, `what_if_retract`, `what_if_assert`) snapshot all truth values before the operation and diff afterward to classify changes into `went_out`/`went_in` lists.

Summary

When the system changes something — like retracting or adding a belief — it takes a snapshot of every truth value beforehand, performs the operation, then compares the new state to the old one. This before-and-after diffing is how the API reports exactly which beliefs changed status, giving callers a clear picture of the ripple effects of any mutation.

Dependents

These beliefs depend on this one:

Details

Sourceentries/2026/04/29/reasons_lib-api.md