feat(v1): add temporal fall state machine
This commit is contained in:
@@ -293,7 +293,7 @@ git commit -m "feat(v1): add pose quality evidence"
|
||||
- Create: `v1/fall_state.py`
|
||||
- Create: `v1/tests/test_fall_state.py`
|
||||
|
||||
- [ ] **Step 1: Write event timing tests**
|
||||
- [x] **Step 1: Write event timing tests**
|
||||
|
||||
```python
|
||||
def test_confirmed_event_is_emitted_once_after_persistence():
|
||||
@@ -318,12 +318,12 @@ def test_confirmed_person_recovers_before_new_event_is_allowed():
|
||||
assert machine.state_of("7") is FallState.NORMAL
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Run tests to verify failure**
|
||||
- [x] **Step 2: Run tests to verify failure**
|
||||
|
||||
Run: `python -m pytest v1/tests/test_fall_state.py -v`
|
||||
Expected: FAIL because `FallStateMachine` is missing.
|
||||
|
||||
- [ ] **Step 3: Implement the four-state contract**
|
||||
- [x] **Step 3: Implement the four-state contract**
|
||||
|
||||
```python
|
||||
from dataclasses import dataclass
|
||||
@@ -399,12 +399,12 @@ class FallStateMachine:
|
||||
|
||||
Use per-ID state, not global `frame_has_fall`. A source error and a rejected pose must not advance the machine.
|
||||
|
||||
- [ ] **Step 4: Run tests**
|
||||
- [x] **Step 4: Run tests**
|
||||
|
||||
Run: `python -m pytest v1/tests/test_fall_state.py -v`
|
||||
Expected: PASS.
|
||||
|
||||
- [ ] **Step 5: Commit**
|
||||
- [x] **Step 5: Commit**
|
||||
|
||||
```powershell
|
||||
git add v1/fall_state.py v1/tests/test_fall_state.py docs progress.md
|
||||
|
||||
Reference in New Issue
Block a user