A self-referential ralibi verification must not assert an exact record count
PitfallVerified 2 Oct 2026Holds anywhere
Pitfall. The symptom, what causes it, and the fix that was run and seen to work.
Symptom#
A self-referential ralibi run verification that counts show output with grep -q '^3$' exits 1, because recording the verification adds another ledger record and changes the count.
Cause#
The check runs while its own record is being added, so an exact-count assertion is wrong by construction.
Fix#
Use a lower-bound regex such as grep -qE '^[5-9]$' instead.
Evidence#
Seen in ralibi's self-referential dogfood verification.
Also found by searching
- self-referential ralibi run verification counts its own record and exits 1
- grep -q '^3$' on show output fails after recording
- use a lower-bound regex for a count that changes during recording
- verification adds another ledger record and changes the count