Skip to main content

nexcore_homeostasis_primitives/
lib.rs

1//! # Homeostasis Machine — Primitives
2//!
3//! Shared types, enums, and mathematical primitives for building
4//! self-regulating systems inspired by biological homeostasis.
5//!
6//! This is the leaf crate — no internal nexcore dependencies.
7//!
8//! ## Five Laws
9//!
10//! This crate enforces 5 biological design laws structurally:
11//!
12//! 1. **Paired Controls** — `amplification::PairedAmplificationSystem` rejects
13//!    attenuators weaker than their amplifier at registration time.
14//! 2. **Signal Decay** — `signals::DecayingSignal` requires a `half_life`
15//!    duration; signals cannot persist indefinitely.
16//! 3. **Response Ceilings** — `hill::HillCurve` mathematically guarantees
17//!    `response < max_response` for any finite signal.
18//! 4. **Self-Measurement** — `enums::SensorType::SelfMeasurement` enables
19//!    proprioceptive monitoring.
20//! 5. **Proportionality** — `state::SystemState::needs_dampening()` flags
21//!    over-response via configurable thresholds.
22
23#![warn(missing_docs)]
24pub mod amplification;
25pub mod baseline;
26pub mod cascade_order;
27pub mod data;
28pub mod enums;
29pub mod hill;
30pub mod signals;
31pub mod state;
32
33// Convenience re-exports for the most commonly used types.
34pub use amplification::{
35    AmplificationViolation, Amplifier, Attenuator, PairedAmplificationSystem, create_standard_pair,
36};
37pub use baseline::{Baseline, BaselineConfig, BaselineMetric};
38pub use data::{ActionData, ActionResult, MetricSnapshot, SensorReading};
39pub use enums::{
40    ActionType, BaselineMetricType, CircuitState, DecayFunction, HealthStatus, ResponsePhase,
41    SensorType, SignalType, StormPhase, TrendDirection, sensor_to_signal_type,
42};
43pub use hill::{HillCurve, ResponseCeiling, SaturatingResponse, create_biological_response_curve};
44pub use signals::{DecayingSignal, SignalManager};
45pub use state::{MetricHistory, StateTracker, SystemState};