Skip to content

feat: unsupervised entry rule, with shot labels per operating mode - #33

Merged
pizzasaurusrex merged 1 commit into
mainfrom
feat/entry-rule
Nov 13, 2026
Merged

pizzasaurusrex merged 1 commit into
mainfrom
feat/entry-rule

Conversation

@pizzasaurusrex

@pizzasaurusrex pizzasaurusrex commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

Summary

Entry rule (rules.py): while armed, a track in the pool zone raises one UNSUPERVISED_ENTRY (emergency tier) on the first frame it is in the water.

  • No confirmation delay — the PRD makes any armed entry an immediate emergency, and there is no armed empty-pool footage to fit a delay against.
  • A track already lost still raises, so falling in and going straight under isn't left to the 12 s submersion rule.
  • Once per track while armed (coping jitter doesn't re-alert); leaving armed clears it, so re-arming with someone in the water raises.
  • Submersion keeps running in armed mode.

Labels per operating mode (labels.py, shots.yaml):

  • mode is now required on every shot — a silent default had been replaying every clip armed.
  • expected_event + onset_window → expected_events: [{event, onset_window}], because an armed replay of drowning-test.mp4 correctly raises both entry and submersion.
  • A file may be labeled once per mode. The regression harness runs detection/tracking once per file and the rules once per mode (no extra inference).
  • The six backyard clips are swim sessions (people in the water from frame one) → swim. drowning-test.mp4 is the only empty-pool start and is also labeled armed.

Replay tooling: poolguard-replay --mode armed|swim (defaults to the label's mode); HUD shows ENTRY — N in the water while armed and lists every expected event.

Docs: decision log entries, PLAN, README status table (it still said the rules engine was unbuilt), CLAUDE.md labels rule.

Test plan

  • ruff check, ruff format --check
  • pytest (all extras) — new entry-rule, label-schema, HUD, replay-mode and CLI tests; written first and seen failing
  • pytest -m regression on local backyard footage: all event assertions pass in both modes. Only failure is the known adult-exits headcount miss (decision log 2026-10-13)
  • poolguard-replay --video clips/drowning-test.mp4 --labels tests/labels/shots.yaml --mode armed: entry at 1.3 s (jump at ~1.4 s), submersion at 37.0 s, 1 track, nothing else
  • Entry false-alarm rate: needs armed footage of an empty pool (shadow phantoms, someone on the near coping)

@pizzasaurusrex
pizzasaurusrex merged commit 890b4ed into main Nov 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant