mirror of
https://github.com/ruvnet/RuView
synced 2026-06-09 10:13:17 +00:00
46f701bca8
- WindowBuffer: buffers exposable CsiFrames from one (session,source), emits a CsiWindow on a frame-count or duration threshold; computes per-subcarrier mean_amplitude / phase_variance and scalar motion_energy / presence_score / quality_score; skips mixed source/session and mismatched-subcarrier frames. - EventDetector trait + 4 state machines: PresenceDetector (hysteresis on presence_score), MotionDetector (debounced rising/falling edges on motion_energy), QualityDetector (SignalQualityDropped + once-per-stretch CalibrationRequired), BaselineDriftDetector (EWMA baseline → BaselineChanged / AnomalyDetected). Each with new()/with_config() + a public config struct. - EventPipeline: owns a WindowBuffer + Vec<Box<dyn EventDetector>> + IdGenerator; process_frame / flush / add_detector / recent_windows (32-window ring) / with_defaults. - 18 tests (incl. a 150-frame quiet/active/quiet end-to-end run via a seeded LCG + a determinism check). clippy-clean, forbid(unsafe_code), no heavy deps. https://claude.ai/code/session_01CdYAPvRTjcch6YrYf42n1z