Files
Thomas KarnerandClaude Opus 5 51750e1644 Add poorbird seed so the gallery has volume to be built against
The recorded TODO 3.0 decision: generated, not downloaded. No image licensing
question, no binary blobs in git, and it can produce the volume a virtualised
grid actually has to be tested against, which no set of real photos on hand
would.

Frames are written to disk for real, and thumbnails with them. A gallery whose
rows point at files that do not exist tests nothing about the delivery path,
which is the half most likely to be wrong. --no-thumbnails leaves thumb_path
NULL instead, which is how to exercise the queue at volume.

The data imitates what the firmware sends rather than being uniformly random:
bursts of frames around one radar trigger, the first one or two out of the
PSRAM pre-trigger ring, timestamps weighted toward daylight because birds are
diurnal and a gallery grouped by day looks wrong otherwise. Frames within a
burst land milliseconds apart on purpose - that is the received_at collision
the gallery cursor has to survive, and a seed that spread a burst over minutes
would never reproduce the paging bug it causes.

--clear is scoped by device_uid prefix, and that is the whole reason the prefix
exists. This command holds a DELETE over the same tables a real camera writes
to, so the property worth having is not that it removes seeded rows but that it
removes nothing else. The test for that is the one to keep: it puts a non-seed
device with a capture alongside the seeded ones and asserts both survive.

That test was mutation-checked against a scratch database rather than the dev
one, deliberately - a widened clear() would have taken the six real captures
with it, and verifying a safety property is not worth risking the thing it
protects. Against the scratch database, removing the scoping failed exactly
that test and nothing else.

The seed device is issued no token. It is a row for the gallery to point at,
not a camera, and giving it a working credential would be creating a real way
in for the sake of test data.

One flaky test found and fixed rather than re-run. test_every_burst_has_
pre_trigger_frames failed about one run in fifteen, because a count that is
not a multiple of the burst size left a truncated final burst - sometimes of
one frame, which is necessarily all pre-trigger, so "not all frames are
pre-trigger" did not hold. Both sides were wrong: a one-frame burst with
burst_count=1 is not something a camera sends, so the generator now absorbs a
short tail into the previous burst (bursts are 3-7 rather than 3-5), and the
test states its precondition instead of assuming it. Verified by running the
randomised tests fifteen times with the fix (0 failures) and fifteen times
without it (1 failure), rather than by one green run.

Tests: 293 -> 308.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-21 19:27:27 +02:00
..