//! Governance workflows for pattern promotion.
//!
//! Implements structured approval workflows with full audit trails for SOC 2 compliance.
//!
//! # Overview
//!
//! When governance is enabled, pattern promotion requires going through an approval workflow
//! with defined stages. Each stage can have required approvers, timeouts, and escalation paths.
//!
//! # Workflow
//!
//! ```text
//! Pattern promotion candidate detected
//!         ↓
//! Approval request created
//!         ↓
//! ┌───────────────────────────┐
//! │ Stage: security_review    │
//! │ Required: security-team   │
//! │ Timeout: 48 hours         │
//! └───────────────────────────┘
//!         ↓ approve
//! ┌───────────────────────────┐
//! │ Stage: architecture_review│
//! │ Required: arch-team       │
//! │ Timeout: 72 hours         │
//! └───────────────────────────┘
//!         ↓ approve
//!    Pattern promoted
//! ```
//!
//! # State Machine
//!
//! ```text
//! Created ──▶ Pending(stage_0)
//!                 │
//!         ┌───────┴───────┐
//!         │               │
//!     approve         reject
//!         │               │
//!         ▼               ▼
//! Pending(stage_n+1)  Rejected
//!         │
//!         ├── (last stage) ──▶ Approved
//!         │
//!         └── (timeout) ──▶ Escalated ──▶ Pending(escalate_to)
//!                                 │
//!                                 └── (no escalate_to) ──▶ Expired
//! ```
//!
//! # Example Configuration
//!
//! ```toml
//! [governance]
//! enabled = true
//! default_workflow = "standard_review"
//!
//! [[governance.workflows]]
//! name = "standard_review"
//! description = "Standard pattern review for production promotion"
//!
//! [[governance.workflows.stages]]
//! name = "security_review"
//! label = "Security Review"
//! required_approvers = ["security-team"]
//! timeout_hours = 48
//! ```

mod audit;
mod state_machine;
mod store;
mod types;
pub mod workflow;

pub use audit::{AuditEvent, AuditEventType, AuditTrail, ExportFormat};
pub use state_machine::GovernanceStateMachine;
pub use store::{governance_store_dir, GovernanceStore};
pub use types::{ApprovalDecision, ApprovalRequest, ApprovalStatus, Decision};
pub use workflow::{
    fast_track_workflow, standard_review_workflow, ApprovalStage, ApprovalWorkflow,
};
