Current Version: 0.2.1 · License: MIT · Last Updated: 2026-05-04
This roadmap outlines the development plan for Micro-BLSS, organized by priority order. Each milestone builds upon the previous one to systematically evolve the project from a functional simulation MVP to a hardware-integrated, AI-driven closed-loop life support digital twin.
v0.1.0 ✅ Initial MVP — MEC plant model, stability monitoring, V&V suite
│
─────┼──────────────── Phase 1: Mathematical Fidelity ────────────────
│
1A ✅│ V-HAB 5×5 CQY/T_A polynomial matrices + age-dependent CUE_24
1B ✅│ Multi-crop parameter library (9 MELiSSA crops)
1C ✅│ Crew activity scheduling (sleep/nominal/active daily cycle)
1D ✅│ Oscillation detection (FFT) + Phase-plane analysis
│
v0.2.0 ✅ Mathematical Fidelity Release (207 tests)
│
1E ✅│ NASA JPL "Power of Ten" safety-critical refactoring
1F ✅│ Property-based testing (Hypothesis) + Robustness suite
│
v0.2.1 ✅ Safety & Robustness Release (221 tests, 91.5% coverage)
│
─────┼──────────────── Phase 2: Hardware-In-The-Loop ─────────────────
│
2A │ MQTT sensor backend + bridge module
2B │ ESP32 reference hardware + Live Mode dashboard
│
v0.3.0 Hardware-In-The-Loop Release
│
─────┼──────────────── Phase 3: AI-Driven Control ────────────────────
│
3A │ Model Predictive Control (MPC) optimizer
3B │ RL agent + pre-built mission scenario library
│
v0.4.0 Autonomous Control Release
Status: ✅ Complete — merged into main.
What was implemented:
- V-HAB empirical 5×5 polynomial coefficient matrices for CQY_Max and T_A computation, replacing simplified Michaelis-Menten approximation
- Age-dependent CUE_24 interpolation with linear senescence decay (T_Q → T_M) for both legumes and non-legumes
- Photoperiod-aware light/dark cycling based on crop-specific
fPhotoperiod - Biomass growth hard capping at 20% per step
- Golden reference CSV regenerated with 40 test vectors (up from 21)
Status: ✅ Complete — src/modules/crops/ package.
What was implemented:
-
CropParametersdataclass withcompute_cqy_max()andcompute_t_a_seconds()polynomial evaluators - 9 MELiSSA-reference crops: Lettuce, Wheat, Soybean, Rice, Tomato, White Potato, Sweet Potato, Dry Bean, Peanut
-
CROP_REGISTRYdictionary andget_crop()lookup function - All coefficient matrices extracted directly from V-HAB MATLAB source
- Parametrized tests verifying all 9 crops produce positive O₂ at nominal conditions
Status: ✅ Complete — ActivitySchedule dataclass.
What was implemented:
-
ActivityScheduledataclass with configurable daily cycle (8h sleep, 14h nominal, 2h active) - Per-crew-member phase offsets for staggered multi-crew scenarios
-
CrewCompartmentautomatically cycles activity levels based on simulation clock - Backward-compatible static mode (no schedules) preserved
-
Simulationconstructor auto-generates staggered schedules fornum_crew > 1
Status: ✅ Complete — StabilityMonitor rewrite.
What was implemented:
- FFT-based oscillation detection on a rolling window of Cᵢ history
- O₂/CO₂ phase-plane trajectory analysis (converging, diverging, limit_cycle, stable)
- Dominant period and energy concentration metrics
-
get_phase_plane_data()for dashboard plotting - Tests for synthetic oscillatory and stable signals
Status: ✅ Complete.
What was implemented:
- NASA JPL "Power of Ten" Compliance:
- Refactored all modules to use immutable
NamedTuplestate objects (Rule 3). - Achieved high assertion density for physical invariants (Rule 5).
- Implemented loop safety bounds and memory history limits (Rule 2).
- Refactored all modules to use immutable
- Property-Based Testing: Integrated
HypothesisforBufferReservoirverification. - Boundary Safety: Replaced assertions with
ValueErrorfor external boundary checks to ensure production persistence. - Coverage Boost: Reached 91.5% total test coverage.
Priority: 🟡 High — enables the physical-digital bridge.
Changes:
- Implement dual-mode sensor backend in
src/core/sensors.py:MockSensorBackend(existing Gaussian noise)MQTTSensorBackend(subscribes to MQTT topics viapaho-mqtt)
- Create
src/io/mqtt_bridge.pywith:- MQTT client connecting to configurable broker (default:
localhost:1883) - Subscribe topic schema:
habitat/sensor/{o2,co2,humidity,temperature} - Publish topic:
habitat/twin/state(JSON with full simulation state) - Automatic reconnect and QoS 1 for reliability
- MQTT client connecting to configurable broker (default:
- Add
--real-sensorsCLI flag tosimulation.pyfor MQTT mode - Add
--broker-hostand--broker-portCLI arguments - Write integration tests with a mock MQTT broker
Verification: Simulation runs in MQTT mode, receives mock sensor data from a test publisher, and publishes twin state back.
Priority: 🟢 Normal — maker/education community enablement.
Changes:
- Create
hardware/esp32/with Arduino sketch for:- DHT22 (temperature + humidity)
- MH-Z19B (CO₂ concentration)
- VEML7700 or BH1750 (light intensity / PAR proxy)
- WiFi + MQTT publish to
habitat/sensor/*topics
- Create
hardware/README.mdwith:- Bill of materials (BOM) with approximate costs
- Wiring diagrams (Fritzing or KiCad)
- Sensor calibration guide
- Mosquitto broker setup on Raspberry Pi
- Add "Live Mode" tab to Streamlit dashboard:
- Real-time MQTT sensor data vs. twin predictions
- Visual diff overlay highlighting divergence
- Alert when physical readings diverge from twin by >10%
- Document the full HIL setup in
docs/hardware_in_the_loop.md
Verification: End-to-end test with ESP32 hardware connected to the simulation via MQTT broker. Dashboard shows live sensor overlay.
Priority: 🟢 Normal — intelligent ECLSS setpoint management.
Changes:
- Create
src/control/mpc.pywith:- Objective function: minimize energy while maintaining O₂ > 19.5%, CO₂ < 5000 ppm, humidity within bounds
- Prediction horizon: configurable (default 24h lookahead)
- Control variables: PAR intensity, CDRA setpoint, dehumidifier setpoint
- Solver:
scipy.optimize.minimize(evaluatecasadiif performance is insufficient)
- Integrate MPC into the
Simulation.step()loop as an optional controller - Add MPC toggle and parameter sliders to the Streamlit dashboard
- Compare MPC-controlled vs. PID-controlled simulation runs
- Write tests verifying MPC maintains safety margins under perturbation
Verification: MPC-controlled 72h simulation maintains all safety thresholds while using less "energy" (lower total PAR + CDRA duty cycle) than PID-only control.
Priority: 🟢 Normal — long-duration adaptive control and educational scenarios.
Changes:
- Create
src/control/rl_agent.pywithgymnasium-compatible environment wrapper:- Observation space:
{O₂%, CO₂_ppm, humidity_kg, biomass_kg, Cᵢ, TTF, time_hours} - Action space:
{PAR_intensity, CDRA_setpoint, dehumidifier_setpoint} - Reward: weighted sum of safety margins, energy efficiency, and crop yield
- Observation space:
- Train baseline PPO agent using
stable-baselines3 - Create
src/scenarios/with pre-built mission profiles:mars_transit_150d.py— 150-day transit with crew sleep/wake cycling and periodic crop harvestslunar_gateway_90d.py— 90-day lunar station with resupply eventssealed_room_72h.py— Short-duration sealed room (hobby/maker scenario)
- Add scenario selector and RL agent toggle to the Streamlit dashboard
- Monte Carlo uncertainty visualization (fan charts for O₂/CO₂ trajectories)
- Export simulation results to CSV/Parquet
Verification: RL agent survives a 30-day simulation with injected perturbations without breaching safety thresholds.
| Need | Tool | Decision | Rationale |
|---|---|---|---|
| CQY data source | V-HAB polynomial matrices | Adopted ✅ | Primary source; 5×5 bivariate polynomials extracted |
| Crop parameters | V-HAB PlantParameters.csv |
Adopted ✅ | 9 crops extracted with full coefficient matrices |
| MQTT client | paho-mqtt |
Adopt | Already in pyproject.toml; production-grade |
| MPC solver | scipy.optimize |
Adopt | Already a dependency; sufficient for initial MPC |
| Nonlinear MPC | casadi |
Evaluate later | Only if scipy.optimize performance is insufficient |
| RL environment | gymnasium |
Adopt | De-facto standard; lightweight wrapper |
| RL agent | stable-baselines3 |
Adopt | Battle-tested PPO/SAC implementations |
| Data export | pandas |
Adopt | Already available; CSV/Parquet out of the box |
| Richer charts | plotly |
Evaluate | Optional; Streamlit native may suffice |
| Time-series DB | InfluxDB | Defer | Only needed for persistent HIL storage |
| Target hardware | ESP32 | Prioritize | Cheaper, Wi-Fi built-in, Arduino ecosystem |
| Linting | ruff |
Adopted ✅ | Fast, comprehensive; in CI pipeline |
| License | MIT | Adopted ✅ | Maximum adoption; community standard for research tools |
See AGENTS.md for coding standards, testing requirements, and development workflow. All contributions must:
- Pass
uv run pytest tests/ -vwith zero failures - Maintain coverage >80% (
uv run pytest tests/ --cov=src) - Include type hints compatible with strict
mypy - Follow conventional commit messages (
feat:,fix:,refactor:,docs:,test:) - Update
CHANGELOG.mdunder[Unreleased]for every feature, fix, or refactor