feat: Contrastive CSI Embedding Model — ADR-024 (all 7 phases) #52

Merged
ruvnet merged 5 commits from feat/adr-024-contrastive-csi-embedding into main 2026-03-01 14:44:39 +08:00

5 Commits

Author SHA1 Message Date
ruv
4b36d7c9d7 fix: add feat/* branch pattern to CI workflow triggers
Push events for feat/ branches were not matching the feature/ glob,
causing CI to skip on all feat/* branches.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 01:41:36 -05:00
ruv
7092f83b34 chore: add workspace metadata and crate READMEs for publishing
Add license, authors, repository, documentation, keywords, categories,
and readme fields to all crate Cargo.toml files. Add crate-level README
files for documentation.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 01:39:36 -05:00
ruv
aa1059d9e2 fix: upgrade deprecated GitHub Actions and remove unwrap
- actions/upload-artifact v3→v4 (v3 deprecated, blocks all CI jobs)
- actions/setup-python v4→v5
- actions/download-artifact v3→v4
- github/codeql-action/upload-sarif v2→v3
- codecov/codecov-action v3→v4
- peaceiris/actions-gh-pages v3→v4
- actions/create-release v1→softprops/action-gh-release v2
- Gate Slack notifications on webhook secret presence
- Fix k8s compliance check to skip when k8s/ dir missing
- Replace unwrap() with match in info_nce_loss_mined

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 01:38:51 -05:00
ruv
0826438e0e feat: ADR-024 Phase 7 — MicroLoRA, EWC++, drift detection, hard-negative mining
Deep RuVector integration for the Contrastive CSI Embedding Model:

- MicroLoRA on ProjectionHead: rank-4 LoRA adapters (1,792 params/env,
  93% reduction vs full retraining) with merge/unmerge, freeze-base
  training, and per-environment LoRA weight serialization
- EWC++ consolidation in Trainer: compute Fisher information after
  pretraining, apply penalty during supervised fine-tuning to prevent
  catastrophic forgetting of contrastive structure
- EnvironmentDetector in EmbeddingExtractor: drift-aware embedding
  extraction with anomalous entry flagging in FingerprintIndex
- Hard-negative mining: HardNegativeMiner with configurable ratio and
  warmup, info_nce_loss_mined() for efficient contrastive training
- RVF SEG_LORA (0x0D): named LoRA profile storage/retrieval with
  add_lora_profile(), lora_profile(), lora_profiles() methods
- 12 new tests (272 total, 0 failures)

Closes Phase 7 of ADR-024. All 7 phases now complete.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 01:27:46 -05:00
ruv
5942d4dd5b feat: ADR-024 AETHER — Contrastive CSI Embedding Model
Implements Project AETHER (Ambient Electromagnetic Topology for
Hierarchical Embedding and Recognition): self-supervised contrastive
learning for WiFi CSI fingerprinting, similarity search, and anomaly
detection.

New files:
- docs/adr/ADR-024 — full architectural spec (1024 lines) with
  mathematical foundations, 6 implementation phases, 30 SOTA references
- embedding.rs — ProjectionHead, CsiAugmenter, InfoNCE loss,
  FingerprintIndex, PoseEncoder, EmbeddingExtractor (909 lines)

Modified:
- main.rs — CLI flags: --pretrain, --pretrain-epochs, --embed, --build-index
- trainer.rs — contrastive pretraining loop integration
- graph_transformer.rs — body_part_features exposure for embedding extraction
- rvf_container.rs — embedding segment type support
- lib.rs — embedding module export
- README.md — collapsible AETHER section with architecture, training modes,
  index types, and model size table

53K params total, fits in 55 KB on ESP32. No external ML dependencies.

Co-Authored-By: claude-flow <ruv@ruv.net>
2026-03-01 01:18:30 -05:00