bookmark/tests
pyr0ball 2b4875d77c fix: handle empty-platform captures, no-op fires, and observe races
- IntakeSession.observe_frame now catches ValueError from crop_to_book
  (empty-platform capture), cleans up any orphan wide-image file/dir,
  resets the strategy, and does not advance session state. The error
  is surfaced via a new last_error field.
- /api/observe adds an "error" field to the response when a capture
  fires but fails, instead of an unhandled 500.
- observe_frame only reports fired=True (and only runs capture logic)
  when state is WAITING_FRONT or WAITING_BACK, so a completed book
  left on the platform can no longer produce a no-op "fired" capture
  from an auto-strategy re-triggering.
- observe_frame now holds a per-session threading.Lock for its whole
  body, since the frontend polls /api/observe every ~500ms without
  chaining requests and Catalogue.update_row() does a non-atomic
  read-all-then-rewrite-whole-file rewrite of catalogue.csv.

Adds tests for empty-platform front/back captures and the
BOOK_COMPLETE no-op-fire case, plus an API-level empty-platform test.
2026-07-13 11:22:08 -07:00
..
__init__.py chore: scaffold bookmark project structure 2026-07-13 10:08:41 -07:00
test_api.py fix: handle empty-platform captures, no-op fires, and observe races 2026-07-13 11:22:08 -07:00
test_camera.py fix: release camera capture handle on failed or repeated open 2026-07-13 10:44:47 -07:00
test_catalogue.py feat: add CSV catalogue data layer 2026-07-13 10:11:49 -07:00
test_config.py feat: add config loading, calibration script, and production entrypoint 2026-07-13 11:08:48 -07:00
test_image_processing.py feat: add book-region cropping from wide captures 2026-07-13 10:24:05 -07:00
test_manual_button_strategy.py feat: add capture strategy interface and manual button strategy 2026-07-13 10:28:10 -07:00
test_motion_stop_strategy.py feat: add motion-stop countdown capture strategy 2026-07-13 10:33:12 -07:00
test_run.py feat: add config loading, calibration script, and production entrypoint 2026-07-13 11:08:48 -07:00
test_session.py fix: handle empty-platform captures, no-op fires, and observe races 2026-07-13 11:22:08 -07:00
test_sizing.py feat: add deterministic marker-based size bucketing 2026-07-13 10:19:10 -07:00
test_stable_centered_strategy.py feat: add stable-centered auto-detect capture strategy 2026-07-13 10:36:54 -07:00