fix(healing): judge post-heal verification against the pre-heal decisions #7

Merged
patrick merged 1 commits from fix/verify-ignores-new-decisions into main 2026-11-14 04:34:01 +00:00
1 Commits
Author SHA1 Message Date
patrickandClaude Opus 5.5 16338a2507 fix(healing): judge post-heal verification against the pre-heal decisions
CI / Unit tests (push) Successful in 3s
CI / Unit tests (pull_request) Successful in 3s
A decision issued in the seconds between a heal and its verification is
missing from the kernel until the bouncer's next poll, so verification
reported the heal as failed even though it had fixed the drift it was
started for. Seen on a node: a metadata heal fixed a stale TTL, a new
ban arrived inside the 5 s window, and the heal was logged as failed;
the next audit found the node in sync.

reconcile() now records the decision values it saw (last_truth_values)
and takes an optional baseline_truth. Post-heal verification passes the
values the drift was found against; values whose LAPI membership changed
since then are left out of the drift, logged with a count, returned as
lapi_changed_values, and checked by the next regular audit. Drift on
decisions that existed when the heal started still fails verification.
The regular audit and the membership re-check are unchanged.

Tests: baseline handling in reconcile, the verification call, and a
replay of the logged sequence (failed before, success now). 78 tests.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-13 23:32:41 -05:00