move_detect/tests
유창욱 a203c42bf3 feat(zones): occupancy rule engine - lone-worker / capacity / dwell limits
Per-zone declarative safety rules, set in the zone editor and enforced on the
edge from the tracking the pipeline already does (no new geometry, no new model):

- min_workers (2인 1조): 0 < count < minimum sustained 30s -> lone_worker/HIGH.
  A solo worker in a buddy-rule zone is a compliance violation and a rescue-
  delay risk, so it outranks the other two.
- max_workers: count > limit sustained 10s -> overcapacity/WARNING.
- max_dwell_s: one track's continuous stay past the limit -> overstay/WARNING.
  A short detection dropout (<=5s grace) does NOT reset the dwell timer -
  without that, run_once's stale-track filter would quietly neuter every
  10-minute rule at real-world detection rates.

Edge: detectors/occupancy.py consumes Zone.rules; the engine flips the zone
detector's per-track membership into per-zone headcounts (stale tracks already
excluded), so counts always match what was actually detected this tick. Fired
states clear on condition recovery - re-alerts need a fresh violation, not a
cooldown expiry. Malformed rules_json keeps the zone's intrusion detection
alive and logs the rules as inactive (never fail dark).

Server: move_zones.rules_json (nullable JSON, migration included) validated
strictly in ZoneConfigController (bounds, min<=max, unknown keys rejected -
a silently dropped rule is one the operator believes is active). Delivered to
the edge unchanged via GET /api/config. EventValidator accepts the 3 new types.

UI: zone editor gains the three rule fields (dwell entered in minutes, wired
in seconds) and shows each zone's rules in its list row; the events console
and detail view now render every event type in Korean (wire codes fall back).

Verified: pytest 216 pass / PHPUnit 123 pass + real-render harness in Chrome
(editor save payload, list labels, console type labels).
2026-08-06 19:33:12 +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(zones): occupancy rule engine - lone-worker / capacity / dwell limits 2026-08-06 19:33:12 +09:00
test_events.py feat(edge): Event model + severity mapping (§7.3 payload) 2026-07-11 20:34:57 +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 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_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