frame_sentinel/
lib.rs

1//! # Frame Sentinel - Multi-Dimensional Trust Scoring and Relationship Management
2//!
3//! **CRITICAL:** Single scalar trust is dangerous and attackable. This crate provides
4//! orthogonal trust dimensions and policy-based access control.
5//!
6//! ## Features
7//!
8//! ### 🛡️ Multi-Dimensional Trust
9//!
10//! Track independent trust dimensions to prevent single-point-of-failure attacks:
11//!
12//! - **Identity Trust (Voice)**: Biometric voice pattern matching
13//! - **Identity Trust (Typing)**: Behavioral keystroke dynamics
14//! - **Identity Trust (Face)**: Facial recognition (future)
15//! - **Location Consistency**: Geospatial pattern verification
16//! - **Relationship Trust**: Interaction history and social connections
17//! - **Device Trust**: Known device fingerprint matching
18//!
19//! ### 📊 Progressive Trust Levels
20//!
21//! Users must prove identity over time:
22//!
23//! - **Unknown** (0.0): First encounter
24//! - **Observed** (0.1-0.3): 3+ matching authentications
25//! - **Verified** (0.4-0.6): 20+ auths over 2 weeks
26//! - **Trusted** (0.7-0.9): 100+ auths over 3 months
27//! - **InnerCircle** (1.0): Explicit approval required
28//!
29//! ### 🔗 Relationship Graph
30//!
31//! Track social connections with transitive inference:
32//!
33//! - Direct relationships (parent, sibling, friend, colleague)
34//! - Inferred relationships (grandparent, uncle, cousin)
35//! - Trust propagation through social graph
36//!
37//! ## Usage
38//!
39//! ```rust,no_run
40//! use sam_trust::{TrustScoreStore, TrustLevel};
41//! use sam_trust::{RelationshipGraph, RelationType};
42//!
43//! // Track trust progression
44//! let trust_store = TrustScoreStore::new("trust.db").unwrap();
45//! trust_store.record_successful_auth("user123").unwrap();
46//!
47//! let trust = trust_store.get_trust_score("user123").unwrap();
48//! println!("Trust level: {:?} ({:.2})", trust.level, trust.score);
49//!
50//! // Manage relationships
51//! let mut graph = RelationshipGraph::new();
52//! graph.add_relationship("sam", "magnus", RelationType::Creator);
53//! graph.add_relationship("magnus", "john", RelationType::Sibling);
54//!
55//! // Infer transitive relationships
56//! let relationships = graph.get_all_relationships("sam", "john");
57//! // Returns: [Uncle] (inferred from creator → sibling chain)
58//! ```
59
60pub mod multidimensional_trust;
61pub mod trust_scoring;
62pub mod relationships;
63
64// Re-export main types
65pub use multidimensional_trust::{
66    MultiDimensionalTrustManager, TrustDimensions, TrustDimension,
67    TrustPolicy, PolicyMode, TrustCondition, TrustError,
68};
69pub use trust_scoring::{
70    TrustScoreManager, TrustScore, TrustLevel, TypingPattern, AuthenticationAttempt,
71    TrustScoreError,
72    TRUST_UNKNOWN, TRUST_OBSERVED, TRUST_VERIFIED, TRUST_TRUSTED, TRUST_INNER_CIRCLE,
73};
74pub use relationships::{RelationshipGraph, RelationType, Relationship, RelationshipSource};