Skip to content

Refuse to record an empty snapshot over one that has rows - #439

Merged
abrignoni merged 1 commit into
mainfrom
fix/refuse-empty-baseline-overwrite
Aug 25, 2026
Merged

Refuse to record an empty snapshot over one that has rows#439
abrignoni merged 1 commit into
mainfrom
fix/refuse-empty-baseline-overwrite

Conversation

@abrignoni

Copy link
Copy Markdown
Owner

An artifact that needs an optional dependency disables itself and returns nothing when that dependency is absent. Recording on a machine without it therefore replaces real rows with zero, and the snapshot then asserts the absence as the correct answer. Nothing errors and the gate goes green on the wrong data.

The recorder now compares against the newest existing snapshot for the same unit and refuses the write when this run produced 0 rows and that one has rows, naming both counts. --allow-empty records anyway, for when an artifact genuinely stopped finding anything.

Measured on ALEAPP without sqlcipher3: threema_messages (33 rows) and threema_contacts (3) both refused, threema_account unaffected because it does not need the dependency. A first-ever recording is never blocked.

Recorder only. run_test_cases.py calls process_artifact directly, so the gate still fails on a genuine drop to zero rather than skipping it.

An artifact that needs an optional dependency disables itself and returns
nothing when that dependency is absent. Recording on a machine without it
therefore replaces real rows with zero, and the snapshot then asserts the
absence as the correct answer. Nothing errors, the recorder prints its usual
saved-to line, and the gate goes green on the wrong data.

The recorder now compares against the newest existing snapshot for the same
unit and refuses the write when this run produced 0 rows and that one has rows,
naming the counts and pointing at the run log. --allow-empty records anyway,
for when an artifact genuinely stopped finding anything.

Measured on ALEAPP without sqlcipher3, which has no wheel on every platform:
threema_messages 33 rows and threema_contacts 3 both refused, threema_account
unaffected because it does not need the dependency. A first-ever recording is
never blocked, since there is no prior snapshot to compare against.

This is the recorder only. run_test_cases.py calls process_artifact directly,
so the gate still fails on a genuine drop to zero rather than skipping it.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@abrignoni
abrignoni merged commit 2c8b95e into main Aug 25, 2026
8 checks passed
@abrignoni
abrignoni deleted the fix/refuse-empty-baseline-overwrite branch August 25, 2026 19:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant