//! Pattern Promotion for Aphoria.
//!
//! When LLM-extracted patterns reach critical mass (5+ projects, >0.8 confidence),
//! they can be promoted to permanent, fast regex extractors. This closes the
//! learning loop: patterns discovered by LLM become codified as declarative extractors.
//!
//! # Flow
//!
//! ```text
//! LearnedPattern (5+ projects, >0.8 confidence)
//!         │
//!         ▼
//! PromotionPipeline.get_candidates()
//!         │
//!         ▼
//! RegexGenerator (Gemini) — generate regex from example
//!         │
//!         ▼
//! Candidate DeclarativeExtractorDef
//!         │
//!         ▼
//! ExtractorValidator.validate() — test against stored example
//!         │
//!         ▼
//! Human review (or auto_promote in Phase 9)
//!         │
//!         ▼
//! YamlWriter → .aphoria/extractors/learned/
//!         │
//!         ▼
//! PatternStore.mark_promoted()
//! ```
//!
//! # CLI Commands
//!
//! ```bash
//! # List patterns eligible for promotion
//! aphoria extractors candidates [--verbose]
//!
//! # Interactive review session
//! aphoria extractors review [--limit 10] [--auto]
//!
//! # Promote a specific pattern by ID
//! aphoria extractors promote <pattern_id> [--force]
//!
//! # Show learning/promotion statistics
//! aphoria extractors stats
//! ```
//!
//! # Configuration
//!
//! ```toml
//! [learning.promotion]
//! min_projects = 5                              # Projects needed
//! min_confidence = 0.8                          # Average confidence needed
//! auto_promote = false                          # Require human review
//! output_dir = ".aphoria/extractors/learned"    # Where to write YAML
//! require_review = true                         # Always require human approval
//! ```

mod audit;
mod pipeline;
mod regex_gen;
mod review;
mod types;
mod validator;
pub mod version;
mod writer;

// Re-export public types
pub use audit::{
    AppliedThresholds, AutonomousAuditLog, AutonomousDecision, DecisionOutcome, PatternValues,
    ValidationState,
};
pub use pipeline::{PromotionPipeline, SmartPromotionResult};
pub use regex_gen::{generate_extractor_name, RegexGenerator};
pub use review::{
    display_candidate, display_candidates_summary, InteractiveReviewer, ReviewResult,
};
pub use types::{
    PromotionCandidate, PromotionMetadata, PromotionStats, ReviewDecision, ValidationResult,
};
pub use validator::ExtractorValidator;
pub use version::{
    compute_metrics_delta, ChangelogEntry, ExtractorChangelog, ExtractorVersion, MetricsDelta,
    VersionStore,
};
pub use writer::YamlWriter;
