wm_workspace/lib.rs
1//! WhiteMagic global workspace bus — salience-based multi-objective arbitration.
2//!
3//! All cognitive cores publish state events to the workspace. The workspace
4//! arbitrates attention: whichever core has the highest salience score wins
5//! the "spotlight" for the next decision cycle.
6//!
7//! Design:
8//! - Salience scoring: multiplicative (urgency × novelty × confidence)
9//! - Spotlight decay: 0.5^(age / half_life), half_life defaults to 5s
10//! - High-salience events (>0.8 composite) preempt the current spotlight
11//! - Event bus: tokio::sync::broadcast channel for multiple subscribers
12//! - Event backlog: ring buffer of last 256 events
13
14#![forbid(unsafe_code)]
15
16pub mod bus;
17pub mod event;
18pub mod salience;
19pub mod spotlight;
20
21pub use bus::{GlobalWorkspace, WorkspaceError, WorkspaceStats};
22pub use event::{CoreId, EventType, WorkspaceEvent};
23pub use salience::Salience;
24pub use spotlight::{Spotlight, SpotlightEntry};