Implements #116 — hardware validation testing for edge crisis detector
on Raspberry Pi 4 and other edge devices.
Adds edge detector (keyword + optional Ollama model), crisis_resources.json,
deployment docs, and two test files:
- test_edge_detector.py: unit tests for keyword logic
- test_edge_detector_hardware.py: hardware validation suite
Hardware validation measures keyword detection (<1ms), model inference (<5s
on Pi 4), offline operation, and provides reproducible benchmark via
`python3 edge/detector.py --benchmark`.
Re-implements the functionality from closed PR #111 with expanded tests.
The test `test_levels_ordered_by_quality` asserted strictly descending
`bits_per_channel`, but `q4_0` (4.0 bits) is a non-TurboQuant fallback
placed last regardless of bit width. The design invariant is:
- TurboQuant levels (turbo4→turbo2): ordered by compression_ratio
ascending (more aggressive = more compression)
- Fallback levels (q4_0): placed after all TurboQuant levels as safe
defaults, not part of the quality progression
Changes:
- `test_levels_ordered_by_quality`: Now validates compression_ratio
ordering for TurboQuant levels only, not across fallbacks
- `test_fallback_quant_is_last`: New test ensuring non-TurboQuant
fallbacks always appear after TurboQuant levels
Closes#138Closes#139 (duplicate)