feat(v2): add annotated evidence and alert dispatch
This commit is contained in:
@@ -157,7 +157,7 @@ git commit -m "feat(v2): add reconnecting FFmpeg stream source"
|
||||
- Create: `v2/internal/alert/dispatcher_test.go`
|
||||
- Modify: `docs/api.md`
|
||||
|
||||
- [ ] **Step 1: Write failing rendering and alert tests**
|
||||
- [x] **Step 1: Write failing rendering and alert tests**
|
||||
|
||||
```go
|
||||
func TestRenderUsesRedBorderOnlyForConfirmed(t *testing.T) {
|
||||
@@ -174,12 +174,12 @@ func TestDispatchWritesOnePNGAndRedactedJSONL(t *testing.T) {
|
||||
}
|
||||
```
|
||||
|
||||
- [ ] **Step 2: Verify tests fail**
|
||||
- [x] **Step 2: Verify tests fail**
|
||||
|
||||
Run: `Set-Location v2; go test ./internal/render ./internal/alert -v`
|
||||
Expected: FAIL because both packages are absent.
|
||||
|
||||
- [ ] **Step 3: Implement deterministic evidence outputs**
|
||||
- [x] **Step 3: Implement deterministic evidence outputs**
|
||||
|
||||
```go
|
||||
func Render(bgr []byte, width, height int, result fall.FrameResult) *image.RGBA
|
||||
@@ -189,12 +189,12 @@ func (d *Dispatcher) Dispatch(event fall.Event, image *image.RGBA) (Record, erro
|
||||
|
||||
Draw a 17-point COCO skeleton, box and ASCII `track/state/time` label in the image. Normal/SUSPECT/RETRYING use green/amber/slate respectively; only `CONFIRMED` draws critical red skeleton and a six-pixel image border. Create `YYYYMMDD/FALL-*.png` and append one UTF-8 JSONL line with the V1-compatible public event fields plus source ID, UTC time and relative screenshot path. The dispatcher holds a seen-event-ID set before writing so retried UI messages cannot overwrite an image or replay an alert. Its notifier interface only reports a one-shot notification request; it does not own UI controls.
|
||||
|
||||
- [ ] **Step 4: Run focused tests**
|
||||
- [x] **Step 4: Run focused tests**
|
||||
|
||||
Run: `Set-Location v2; go test ./internal/render ./internal/alert -v`
|
||||
Expected: PASS, including red-only-confirmed, PNG decodability, one JSONL line and no `rtsp`/credential substring.
|
||||
|
||||
- [ ] **Step 5: Commit the rendering and alert slice**
|
||||
- [x] **Step 5: Commit the rendering and alert slice**
|
||||
|
||||
```powershell
|
||||
git add v2/internal/render v2/internal/alert docs/api.md
|
||||
|
||||
Reference in New Issue
Block a user