2.3 KiB
2.3 KiB
Foreground Web Motion Detection Execution Prompt
Implement automatic foreground-only motion detection for the web camera role using the artifacts below as the source of truth:
- FOREGROUND_WEB_MOTION_DETECTION_IMPLEMENTATION_PLAN.md
- FOREGROUND_WEB_MOTION_DETECTION_ABSOLUTE_CHECKLIST.md
- FOREGROUND_WEB_MOTION_DETECTION_VALIDATION_MATRIX.md
Delivery Rules
- Treat the implementation plan as authoritative for architecture and sequencing.
- Complete checklist items atomically and update the validation matrix with evidence as work lands.
- Do not silently skip hidden work such as store updates, detector lifecycle cleanup, tests, docs, and runtime validation.
- Reuse the existing backend motion lifecycle before introducing any new backend motion pipeline.
- Preserve manual motion controls and existing client notification behavior.
Evidence Rules
- Every completed checklist item must have at least one evidence entry in the validation matrix.
Codeevidence must reference the file changed.Testevidence must reference a deterministic automated or manual validation step.Runtimeevidence must reference an observed app behavior, command result, or manual scenario outcome.
Completion Gates
- Automatic motion detection works only for the web
camerarole. - The detector runs only while the browser tab is in the foreground and the detector is armed.
- The detector starts and ends existing motion events automatically without duplicate starts.
- Client notifications and recordings continue to function through existing backend routes.
- Manual motion controls still work.
- Detector settings are user-visible and persisted locally.
- Tests and runtime validation cover idle scenes, real motion, flicker, and camera shake.
Suggested First Batch
- Add store fields and camera dashboard controls.
- Add the detector module with live score reporting only.
- Tune thresholds manually on the camera dashboard.
- Wire automatic start/end to the existing motion event flow.
- Add tests, docs, and validation evidence.