move_detect/edge
유창욱 752aabaff1 fix(edge): forget per-track state on lost tracks (FIX 5)
fall._states, immobility._still_since/_fired, zone._inside_since/_fired,
and engine._last_emit were never pruned when a track was lost (ghost
already pruned via on_lost). On a 24/7 edge device this is unbounded
growth as track IDs keep incrementing.

Add forget(track_id) to FallDetector, ImmobilityWatchdog, and
ZoneIntrusionDetector (drops that track's per-track keys/sets).
EventEngine.forget(track_id) calls each sub-detector's forget and removes
_last_emit cooldown keys whose tuple's second element is that track_id
(covers FALL/NO_MOTION/IMMOBILITY/zone/GHOST — GHOST keys are
(GHOST, track_id) after FIX 4). EventEngine.process now calls
self.forget(tr.track_id) for every track in lost_tracks after emitting,
since ghost.on_lost already consumed that track's ghost-relevant state at
the top of process().

app.py run_once already calls pool.forget(tr.track_id) for lost tracks as
part of FIX 1, completing the cleanup chain (smoother pool + detector
state + dedup cache).

Tests: tests/test_engine.py adds test_forget_prunes_state_on_lost —
fires a FALL event, then passes the track as lost, and asserts
engine._last_emit no longer has that track's keys and fall._states no
longer has the track id.
2026-07-11 22:19:39 +09:00
..
adapters feat(edge): hardware adapter stubs + Pi bring-up/benchmark doc 2026-07-11 21:54:24 +09:00
detectors fix(edge): forget per-track state on lost tracks (FIX 5) 2026-07-11 22:19:39 +09:00
__init__.py feat(edge): data models (Keypoint, BBox, Person) + COCO indices 2026-07-11 20:13:00 +09:00
alert.py feat(edge): PostClient with HMAC+nonce signed event POST 2026-07-11 21:27:38 +09:00
app.py fix(edge): smooth keypoints per-track after tracking, not before (FIX 1) 2026-07-11 22:14:03 +09:00
config.py feat(edge): env-based Config for detectors and transport 2026-07-11 21:40:06 +09:00
engine.py fix(edge): forget per-track state on lost tracks (FIX 5) 2026-07-11 22:19:39 +09:00
events.py feat(edge): Event model + severity mapping (§7.3 payload) 2026-07-11 20:34:57 +09:00
geometry.py feat(edge): pose geometry utils (torso angle, com, normalization) 2026-07-11 20:18:03 +09:00
models.py feat(edge): data models (Keypoint, BBox, Person) + COCO indices 2026-07-11 20:13:00 +09:00
ports.py feat(edge): Track model + IoU tracker with lost-track reporting 2026-07-11 20:28:45 +09:00
queue.py feat(edge): OfflineQueue (SQLite persist + ordered resend) 2026-07-11 21:33:43 +09:00
smoothing.py fix(edge): smooth keypoints per-track after tracking, not before (FIX 1) 2026-07-11 22:14:03 +09:00
snapshot.py feat(edge): RingBuffer + face blur + JPEG snapshotter 2026-07-11 21:21:57 +09:00
tracking.py feat(edge): Track model + IoU tracker with lost-track reporting 2026-07-11 20:28:45 +09:00