vex_adversarial/
lib.rs

1//! # VEX Adversarial
2//!
3//! Red/Blue agent pairing for adversarial verification.
4//!
5//! Every "Blue" agent can have a "Red" shadow that challenges its conclusions,
6//! reducing hallucinations and improving reliability.
7//!
8//! ## Key Types
9//!
10//! - [`ShadowAgent`] — Red agent that challenges Blue's outputs
11//! - [`Debate`] — Multi-round debate between agents
12//! - [`Consensus`] — Voting protocols for agreement
13//!
14//! ## Quick Start
15//!
16//! ```rust
17//! use vex_adversarial::{ShadowAgent, ShadowConfig, Consensus, ConsensusProtocol, Vote};
18//! use vex_core::{Agent, AgentConfig};
19//!
20//! // Create a Blue agent
21//! let blue = Agent::new(AgentConfig::default());
22//!
23//! // Create its Red shadow
24//! let shadow = ShadowAgent::new(&blue, ShadowConfig::default());
25//!
26//! // Detect issues in a claim
27//! let issues = shadow.detect_issues("This always works 100% of the time.");
28//! // Returns: ["Universal claim detected - verify no exceptions exist"]
29//! ```
30//!
31//! ## Consensus Voting
32//!
33//! ```rust
34//! use vex_adversarial::{Consensus, ConsensusProtocol, Vote};
35//!
36//! let mut consensus = Consensus::new(ConsensusProtocol::SuperMajority);
37//! consensus.add_vote(Vote::new("agent1", true, 0.9));
38//! consensus.add_vote(Vote::new("agent2", true, 0.8));
39//! consensus.add_vote(Vote::new("agent3", false, 0.7));
40//! consensus.evaluate();
41//!
42//! assert!(consensus.reached);
43//! ```
44
45pub mod consensus;
46pub mod debate;
47pub mod reflection;
48pub mod shadow;
49
50pub use consensus::{Consensus, ConsensusProtocol, Vote};
51pub use debate::{Debate, DebateRound};
52pub use reflection::{ReflectionAgent, ReflectionConfig, ReflectionResult};
53pub use shadow::{ShadowAgent, ShadowConfig};