feat(fullstack): R1 STA/LTA cross-validation via SIL pipeline - #365
Merged
Conversation
- Extract pure-C++ STA/LTA core into DetectionCore.h (shared firmware/host) - Refactor main.cpp sensorTask onto the shared core - Add native host CLI (detect_cli) for SIL replay - Add research/ Python orchestrator: metrics, calibration sweep, ROC plot, graceful-degradation ITACA fetcher (real token path + realistic synthetic) - Extend iot-ci with native core + CLI build and synthetic smoke test - Mark R1 implemented in ROADMAP/README; add v2.2.0 and Future Horizon (K8s/Terraform)
- DetectionCore.h: explicit constructor + member init list (S1709/S3230) - detect_cli.cpp: std::string/std::getline, dedicated declarations, auto (S5945/S1659/S5827) - calibrate.py: math.isclose for float equality (S1244) - calibrate_io.py/fetch_itaca.py/calibrate.py/plot_roc.py: path-injection guard resolve_within_root (S8707) - fetch_itaca.py: drop unused param, int-typed main (S1172/S5886/S3699/S1135) - ci: run SIL smoke test inside gitignored research/out (respects path guard)
- DetectionCore.h: drop redundant ctor init list (members use in-class initializers) (S3230) - detect_cli.cpp: use auto for derived type (S5827)
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
Implements ROADMAP R1 (Scientific Validation / SIL): Software-in-the-Loop cross-validation of the STA/LTA detection core using the exact same C++ code as the ESP32 firmware.
What's included
firmware/src/DetectionCore.h— no Arduino/FreeRTOS/I2C calls, shared 100% between firmware and hostmain.cppsensorTask now uses the shared core; deadALPHA_STA/ALPHA_LTAconstants removedfirmware/tools/detect_cli.cppfor native SIL replay (subprocess bridge)research/Python orchestrator:orchestrator.py— compiles & drives the C++ CLI (sole Python↔C++ bridge)metrics.py— Sensitivity/Recall, False-Alarm Rate, latency, ROCcalibrate.py— sweepTRIGGER_RATIO×NOISE_FLOOR, maximize F1fetch_itaca.py— graceful degradation: real ITACA/ESM path (token-gated) or realistic synthetic fallbacksynthetic.py,plot_roc.py,calibrate_io.py, README, requirementsiot-ci.yml): native core + CLI build, synthetic smoke testVerification
pio run: Flash 78.8% / RAM 12.7% SUCCESSNotes