No description
Find a file
jedarden d41cfe3e4f feat: add CSI frame validation with DEBUG logging and performance benchmark
Implement strict CSI binary frame validation with per-connection malformed
frame counters and automatic connection closure on persistent malformed input.

Validation rules implemented:
- Minimum frame length: 24 bytes (header only)
- Maximum frame length: 280 bytes (24 header + 128 subcarriers × 2 bytes)
- n_sub field: must be ≤128
- Payload length: must equal n_sub × 2 bytes exactly
- channel: must be in [1,14] for 2.4 GHz; drop if 0 or >14
- rssi: 0 treated as invalid/missing (logged at DEBUG, but frame allowed)
- timestamp_us: any uint64 value accepted

Per-connection malformed counter (sliding 60-second window):
- On each validation failure: increment malformed_count; log at DEBUG
- If malformed_count > 100 within 60s: log WARN
- If malformed_count > 1000 within 60s: close WebSocket with message
  'Excessive malformed frames — possible firmware bug'
- Counter resets every 60s

Acceptance criteria met:
- Valid frame: passes all checks in < 1 μs (benchmark test added)
- Frame with n_sub=200: rejected (n_sub > 128)
- Frame with len=10: rejected (< 24 bytes)
- Frame with channel=0: rejected with DEBUG log
- 1001 malformed frames in 60s: connection closed with correct message
- 101 malformed frames: WARN logged, connection kept open
- RSSI=0: allowed but logged at DEBUG for AGC skip

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-04-07 12:22:17 -04:00
.beads feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
.marathon ci: set VERSION to 0.1.0 for image build 2026-04-06 08:53:25 -04:00
dashboard feat: process buffered events from delta WebSocket updates 2026-04-07 11:04:49 -04:00
docs init: spaxel project — docs, plan, and marathon infrastructure 2026-03-26 06:43:25 -04:00
firmware feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
mothership feat: add CSI frame validation with DEBUG logging and performance benchmark 2026-04-07 12:22:17 -04:00
.dockerignore feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
.gitignore feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
.needle-predispatch-sha feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
.needle.yaml feat: trigger CI build and verify deployment 2026-04-06 09:54:08 -04:00
docker-compose.yml feat(deploy): Docker packaging with multi-stage build and compose orchestration 2026-03-26 07:46:15 -04:00
Dockerfile feat: implement comprehensive /healthz endpoint 2026-04-07 11:09:36 -04:00
PROGRESS.md feat(mothership): signal processing package with phase/baseline/motion detection 2026-03-26 08:08:46 -04:00
VERSION ci: auto-bump version to 0.1.59 2026-04-07 16:15:13 +00:00