feat: ADR-069 ESP32 CSI → Cognitum Seed RVF pipeline (v0.5.4-esp32)

Hardware-validated pipeline connecting ESP32-S3 CSI sensing to Cognitum
Seed (Pi Zero 2 W) edge intelligence appliance via 8-dim feature vectors.

Firmware:
- New 48-byte feature vector packet (magic 0xC5110003) at 1 Hz with
  normalized presence, motion, breathing, heart rate, phase variance,
  person count, fall detection, and RSSI
- Compressed frame magic reassigned 0xC5110003 → 0xC5110005
- Guard against uninitialized s_top_k read when count=0

Bridge (scripts/seed_csi_bridge.py):
- UDP→HTTPS ingest with bearer token, hash-based vector IDs
- --validate (kNN), --stats, --compact, --allowed-sources modes
- NaN/inf rejection, retry logic, SEED_TOKEN env var support

Validated on live hardware:
- 941 vectors ingested, 100% kNN exact match
- Witness chain SHA-256 verified (1,325 entries)
- 1,463 Rust tests passed, Python proof VERDICT: PASS

Research: 26 docs covering Arena Physica, Maxwell's equations in WiFi
sensing, SOTA survey 2025-2026, GOAP implementation plan

Security: removed hardcoded credentials, added NVS patterns to
.gitignore, source IP filtering, NaN validation

Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
ruv
2026-04-02 19:32:18 -04:00
parent 3733e54aef
commit a4bd2308b7
40 changed files with 3938 additions and 17 deletions
+15 -1
View File
@@ -26,7 +26,7 @@
/* ---- Magic numbers ---- */
#define EDGE_VITALS_MAGIC 0xC5110002 /**< Vitals packet magic. */
#define EDGE_COMPRESSED_MAGIC 0xC5110003 /**< Compressed frame magic. */
#define EDGE_COMPRESSED_MAGIC 0xC5110005 /**< Compressed frame magic (was 0xC5110003, reassigned for ADR-069). */
/* ---- Buffer sizes ---- */
#define EDGE_RING_SLOTS 16 /**< SPSC ring buffer slots (power of 2). */
@@ -109,6 +109,20 @@ typedef struct __attribute__((packed)) {
_Static_assert(sizeof(edge_vitals_pkt_t) == 32, "vitals packet must be 32 bytes");
/* ---- ADR-069: CSI Feature Vector packet (48 bytes, wire format) ---- */
#define EDGE_FEATURE_MAGIC 0xC5110003 /**< Feature vector packet magic. */
typedef struct __attribute__((packed)) {
uint32_t magic; /**< EDGE_FEATURE_MAGIC = 0xC5110003. */
uint8_t node_id; /**< ESP32 node identifier. */
uint8_t reserved; /**< Alignment padding. */
uint16_t seq; /**< Sequence number. */
int64_t timestamp_us; /**< Microseconds since boot. */
float features[8]; /**< 8-dim normalized feature vector. */
} edge_feature_pkt_t;
_Static_assert(sizeof(edge_feature_pkt_t) == 48, "feature packet must be 48 bytes");
/* ---- ADR-063: Fused vitals packet (48 bytes, wire format) ---- */
#define EDGE_FUSED_MAGIC 0xC5110004 /**< Fused vitals packet magic. */