heldar_entry/config.rs
1//! The access-control app's own configuration, loaded from the environment by the composing server. The open
2//! kernel does not carry any entry-app tuning knobs.
3
4use heldar_kernel::env::parse_or;
5
6#[derive(Clone, Debug)]
7pub struct EntryConfig {
8 /// Minimum reads agreeing on a track's winning plate before the ANPR engine commits an entry
9 /// event (temporal voting). Lower = faster but noisier; higher = more accurate but more latency.
10 pub anpr_min_votes: u32,
11 /// How long entry events (+ their evidence frames) are kept before this app's retention prunes them.
12 pub entry_retention_days: i64,
13}
14
15impl EntryConfig {
16 pub fn from_env() -> Self {
17 EntryConfig {
18 anpr_min_votes: parse_or::<u32>("HELDAR_ANPR_MIN_VOTES", 3).clamp(1, 50),
19 entry_retention_days: parse_or("HELDAR_ENTRY_RETENTION_DAYS", 365),
20 }
21 }
22}