whyno-core 0.5.0

Permission check pipeline, fix engine, and state types
Documentation
//! Impact scoring constants and helpers for fix suggestions.
//!
//! Scores range from 1 (least privilege, most targeted) to 6 (broadest
//! impact). Lower scores preferred -- minimal additional access.

/// ACL entry for a specific user -- most precise fix possible.
pub const ACL_USER_GRANT: u8 = 1;

/// ACL entry for a specific group.
pub const ACL_GROUP_GRANT: u8 = 2;

/// `chmod g+<perm>` -- grants permission to entire owning group.
pub const CHMOD_GROUP: u8 = 3;

/// `chmod o+<perm>` -- grants permission to all users on system.
pub const CHMOD_OTHER: u8 = 4;

/// Removing a filesystem flag (immutable, append-only).
pub const REMOVE_FS_FLAG: u8 = 5;

/// Remounting a filesystem (affects every file on the mount).
pub const REMOUNT: u8 = 6;

/// Returns `true` if impact score warrants a warning.
///
/// Fixes with impact >= 5 affect entire filesystem or remove
/// protective flags, deserving explicit user attention.
#[must_use]
pub fn needs_warning(impact: u8) -> bool {
    impact >= 5
}

#[cfg(test)]
#[path = "scoring_tests.rs"]
mod tests;