# Changelog

All notable changes to the CAVORA project will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

---

## [3.0.0] - 2026-02-14

### 🚀 Major Release - Predictive Risk Anticipation System

#### Added
- **MRDI (Max Risk Dominance Index)**: Replaces misleading simple averages
  - Formula: `MRDI = min(stability) × 1.5` when stability < 40
  - Accurately reflects system health dominated by single high-risk passage

- **Static vs Dynamic Risk Separation**
  - Static Risk: V, L, F (slow-changing geometry)
  - Dynamic Stress: Q, CO2, CDZ (fast-changing factors)
  - Final Risk = max(Static, Dynamic)

- **Confidence Bands (± Uncertainty)**
  - Each stability score includes uncertainty quantification
  - Based on measurement precisions from field equipment
  - Levels: HIGH (<5), MEDIUM (<10), LOW (>10)

- **Complete Reporting System with 3 Formats**
  - 📄 **TXT**: Full detailed reports for field teams (80+ lines)
  - 📊 **MD**: Beautiful markdown reports with tables and formatting
  - 📁 **JSON**: Machine-readable data for automated analysis

- **CDZ Acceleration Detection**
  - Tracks rate of change in CDZ proximity
  - Early warning before thresholds are reached
  - Warning levels: NORMAL, WARNING, CRITICAL

- **What-If Scenario Engine**
  - Simulates Q changes (-20% to +20%)
  - Simulates CO2 changes (-200ppm to +500ppm)
  - Projects stability 6/12/24 hours ahead

#### Changed
- **Complete architecture rewrite** from v2.0
- **Separated concerns** into specialized classes:
  - `TemporalRiskEngine` - derivatives and acceleration
  - `RiskSeparator` - static/dynamic separation
  - `ConfidenceBands` - uncertainty quantification
  - `TopologyAwareness` - passage role identification

#### Fixed
- **Emoji syntax errors** in previous versions
- **JSON serialization** of datetime objects
- **File path handling** with relative paths

#### Performance
- **90% faster** analysis time
- **Memory efficient** - only keeps last 24h of history
- **Lightweight** - runs on Termux without issues

---

## [2.0.0] - 2026-02-14

### Added
- Van der Pol oscillator implementation
- VLF coupling coefficients from research paper
- CDZ detection algorithms
- Basic threshold logic

### Changed
- Enhanced stability calculations
- Improved error handling

### Fixed
- Initial bugs in coefficient calculations

---

## [1.0.0] - 2026-02-14

### Added
- Initial release
- Basic cave passage analysis
- Simple stability scoring
- TXT report generation

---

## Version Comparison

| Version | Date | Key Features | Status |
|---------|------|--------------|--------|
| **v3.0.0** | 2026-02-14 | MRDI, Static/Dynamic, Confidence Bands, 3 Reports | ✅ Current |
| v2.0.0 | 2026-02-14 | Van der Pol, VLF Coupling, CDZ Detection | ⏳ Legacy |
| v1.0.0 | 2026-02-14 | Basic Analysis | ⏳ Legacy |

---

## Upcoming Features (v4.0.0)

- [ ] Machine learning integration for pattern recognition
- [ ] Real-time sensor data streaming
- [ ] Mobile app for field alerts
- [ ] Multi-language support (AR, EN, FR, IT, ES)
- [ ] 3D visualization of passages
- [ ] Automated email/SMS alerts

---

## Notes for Users

### Upgrading from v2.0 to v3.0
```bash
# New features require no migration
# Simply use the new version:
python cavora_v3_final.py
```

File Locations

· TXT Reports: reports/daily/daily_report_*_full.txt
· MD Reports: reports/v3/report_*.md
· JSON Data: reports/daily/data_*.json

---

Contributors

· Samir Baladi (Project Lead)
· CAVORA Development Team

---

Repository

· GitLab: https://gitlab.com/gitdeeper4/cavova
· Documentation: https://cavora-lab.netlify.app

---

License

CC-BY 4.0 International

---

"From Risk Assessment to Risk Anticipation" 🚀

