move_detect/tests
유창욱 9e4225a338 feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay
Heinrich's-law play: the signals we already compute but used to throw away
become a spatial risk map of the workplace, drawn over the camera's own frame.

Edge:
- near_fall (INFO): a track that reached FALLING (sustained prone) but recovered
  before the FALLEN confirm. Treated as a full event per product decision -
  same ingest, snapshots, dedup, ack flow as incidents. Fix en route: prone_s
  used a truthiness check that turned prone_since=0.0 into "no timer".
- Every per-track event (fall/no_motion/near_fall/immobility/zone hits) now
  carries the foot point in the zones' normalized 0..1 space (reusing the zone
  detector's own coordinate math); ghost's pixel-space loss point is normalized
  at emit. to_payload omits the key when absent, so an old server ignores it.

Server:
- move_events.spatial_x/spatial_y (nullable DOUBLE) + validator: optional
  [x, y] finite-number pair; range deliberately NOT enforced (an off-by-a-hair
  foot must never reject a FALL alert - renderers clamp).
- MIGRATION FIX: chk_events_type would have REJECTED the previous commit's
  lone_worker/overcapacity/overstay inserts on MySQL 8.0.16+ - the constraint
  is rebuilt with all 13 types (incl. near_fall).
- GET /api/heatmap/{camera}?days=N (1..90, default 30, 5000-point cap):
  spatial points with the same fail-closed site scoping as the event list.

UI (zone editor): "위험 히트맵" toggle + day window. Additive radial blots in
an offscreen layer under the zone polygons; severity weighs the alpha so a
cluster of near-misses reads lighter than one confirmed fall at the same spot.
Events console/detail label near_fall in Korean.

Verified: pytest 222 pass / PHPUnit 130 pass + Chrome real-render (blue
near-miss cluster + red incident hotspot inside the restricted zone, amber
cluster in the warning zone, zones drawn on top; no console errors).
2026-08-06 20:19:09 +09:00
..
hardware docs: pilot runbook + gated MoveNet smoke test 2026-07-12 11:49:07 +09:00
test_alert.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
test_app.py fix(edge): close audit P2-6/7/8 - id swaps, one-frame FALLING, stale-track timers 2026-08-06 17:01:24 +09:00
test_cafe24_package.py refactor: rename cloud/ to server/ (cafe24 is web hosting, not cloud) 2026-07-20 11:30:52 +09:00
test_config.py fix(delivery): resolve codex + workflow review findings across edge/cloud/deploy 2026-07-17 19:24:42 +09:00
test_daemon.py fix(edge): stop hiding a failed camera; fix ghost dedup leak + silent zone drop 2026-07-25 23:18:19 +09:00
test_deploy_artifacts.py docs(deploy): fix MySQL/runbook/secret guidance; offline camera probe 2026-07-25 19:21:01 +09:00
test_engine.py feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay 2026-08-06 20:19:09 +09:00
test_events.py feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay 2026-08-06 20:19:09 +09:00
test_faceblur.py feat(delivery-audit): privacy — face-blur sizing + model integrity (P3-1, P3-3) 2026-07-17 09:35:02 +09:00
test_fall.py feat(heatmap): near-miss events + spatial ingestion + camera risk-heatmap overlay 2026-08-06 20:19:09 +09:00
test_fetch_hailo_hef.py feat(delivery): install-path fixes + cafe24 package + delivery-audit hardening 2026-07-17 09:07:33 +09:00
test_geometry.py fix(edge): confidence-gate foot/nose keypoints, warn on MoveNet single-person (P2-9/10/11) 2026-07-17 10:25:04 +09:00
test_ghost.py feat(delivery): install-path fixes + cafe24 package + delivery-audit hardening 2026-07-17 09:07:33 +09:00
test_hailo_pose.py feat(delivery): install-path fixes + cafe24 package + delivery-audit hardening 2026-07-17 09:07:33 +09:00
test_health.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
test_immobility.py feat(edge): ImmobilityWatchdog (posture-independent prolonged immobility) 2026-07-11 20:51:33 +09:00
test_models.py feat(edge): data models (Keypoint, BBox, Person) + COCO indices 2026-07-11 20:13:00 +09:00
test_movenet_pose.py fix(edge): confidence-gate foot/nose keypoints, warn on MoveNet single-person (P2-9/10/11) 2026-07-17 10:25:04 +09:00
test_multicam.py fix(delivery): resolve codex + workflow review findings across edge/cloud/deploy 2026-07-17 19:24:42 +09:00
test_occupancy.py feat(zones): occupancy rule engine - lone-worker / capacity / dwell limits 2026-08-06 19:33:12 +09:00
test_picamera_source.py feat(edge): CSI camera source (picamera2) + CAMERA_BACKEND switch 2026-07-12 22:36:05 +09:00
test_probe.py feat(deploy): probe every camera before enabling the service 2026-07-20 23:22:20 +09:00
test_queue.py feat(edge): heartbeat telemetry + monotonic timers + queue/camera robustness 2026-07-25 19:20:23 +09:00
test_runtime.py feat(edge): PipelineRuntime assembles components + hot-swaps zones 2026-07-12 10:54:16 +09:00
test_serverclient.py refactor: rename cloud/ to server/ (cafe24 is web hosting, not cloud) 2026-07-20 11:30:52 +09:00
test_smoothing.py fix(edge): smooth keypoints per-track after tracking, not before (FIX 1) 2026-07-11 22:14:03 +09:00
test_snapshot.py feat(edge): RingBuffer + face blur + JPEG snapshotter 2026-07-11 21:21:57 +09:00
test_tracking.py fix(edge): close audit P2-6/7/8 - id swaps, one-frame FALLING, stale-track timers 2026-08-06 17:01:24 +09:00
test_uvc_source.py feat(delivery): install-path fixes + cafe24 package + delivery-audit hardening 2026-07-17 09:07:33 +09:00
test_zone.py fix(edge): confidence-gate foot/nose keypoints, warn on MoveNet single-person (P2-9/10/11) 2026-07-17 10:25:04 +09:00
test_zones.py feat(zones): occupancy rule engine - lone-worker / capacity / dwell limits 2026-08-06 19:33:12 +09:00