attuned_core/lib.rs
1//! # attuned-core
2//!
3//! Core types and traits for Attuned - a Rust framework for representing human state
4//! as interpretable vectors and translating them into interaction constraints for LLM systems.
5//!
6//! ## Overview
7//!
8//! Attuned produces *context*, not actions. It represents user state across interpretable
9//! dimensions (axes) and translates that state into guidelines for LLM interactions.
10//!
11//! ## Core Types
12//!
13//! - [`StateSnapshot`] - A point-in-time capture of user state
14//! - [`PromptContext`] - Translated guidelines for LLM conditioning
15//! - [`Translator`] - Trait for converting state to context
16//!
17//! ## Example
18//!
19//! ```rust
20//! use attuned_core::{StateSnapshot, Source, RuleTranslator, Translator};
21//!
22//! // Create a state snapshot
23//! let snapshot = StateSnapshot::builder()
24//! .user_id("user_123")
25//! .source(Source::SelfReport)
26//! .axis("warmth", 0.7)
27//! .axis("cognitive_load", 0.9)
28//! .build()
29//! .unwrap();
30//!
31//! // Translate to prompt context
32//! let translator = RuleTranslator::default();
33//! let context = translator.to_prompt_context(&snapshot);
34//!
35//! // Use guidelines in your LLM system prompt
36//! for guideline in &context.guidelines {
37//! println!("{}", guideline);
38//! }
39//! ```
40
41#![deny(missing_docs)]
42#![deny(rustdoc::broken_intra_doc_links)]
43
44pub mod axes;
45mod error;
46mod snapshot;
47pub mod telemetry;
48mod translator;
49mod types;
50
51pub use axes::{
52 get_axis, is_valid_axis_name, Axis, AxisCategory, AxisDefinition, DeprecationInfo,
53 CANONICAL_AXES,
54};
55pub use error::{AttunedError, ValidationError};
56pub use snapshot::{StateSnapshot, StateSnapshotBuilder};
57pub use telemetry::{
58 init_tracing, init_tracing_from_env, AuditEvent, AuditEventType, ComponentHealth, HealthCheck,
59 HealthState, HealthStatus, OtelConfig, TelemetryBuilder, TelemetryGuard, TracingConfig,
60 TracingFormat,
61};
62pub use translator::{PromptContext, RuleTranslator, Thresholds, Translator, Verbosity};
63pub use types::Source;