move_detect/docs/INDEX.md
유창욱 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

1.4 KiB

INDEX — 작업 기록 (완료 결과만)

  • 2026-08-06 대시보드 장치→카메라 트리 레일 + (device,camera) 쌍 카메라 필터 — eaff176. PHPUnit 119 통과 + Chrome 실렌더 검증(트리 상태·필터·접기·콘솔 무오류).
  • 2026-08-06 감사 잔여 P2-6/7/8 종결 (ID 스왑 게이트 · sustained-prone FALLING · stale 트랙 no-data) — 32f2237. TDD(RED 확인), pytest 203 통과/2 skip. → delivery-audit 오프하드웨어 항목 43/43 완료. 잔여는 실장비(OFF-HW) 검증뿐.
  • 2026-08-06 연속성 문서 신설: CLAUDE.md · docs/PROJECT_MAP.md · 본 INDEX.
  • 2026-08-06 니어미스 히트맵: near_fall(FALLING→확정 전 회복, INFO) + 전 트랙 이벤트에 정규화 발좌표(spatial) 부착 → move_events.spatial_x/y 적재 → GET /api/heatmap/{camera} → 존 편집기 '위험 히트맵' 오버레이. 직전 커밋의 chk_events_type 제약 누락(신규 타입 INSERT 거부) 마이그레이션으로 수정. pytest 222/PHPUnit 130 + Chrome 실렌더.
  • 2026-08-06 존 점유 규칙 엔진 (2인1조 lone_worker/HIGH · 정원 overcapacity · 체류상한 overstay): edge occupancy.py + move_zones.rules_json + 존 편집기 규칙 입력 + 이벤트 유형 한글 라벨. pytest 216/PHPUnit 123 통과 + Chrome 실렌더(편집기 저장·목록·콘솔 라벨).