Application runtime for systemprompt.io AI governance infrastructure. AppContext, lifecycle builder, extension registry, and module wiring for the MCP governance pipeline.
usecrate::AppContext;useanyhow::{Result, bail};usestd::path::Path;usesystemprompt_database::validate_database_connection;pub async fnvalidate_system(ctx:&AppContext)->Result<()>{validate_database(ctx).await?;Ok(())}
async fnvalidate_database(ctx:&AppContext)->Result<()>{validate_database_path(&ctx.config().database_url)?;validate_database_connection(ctx.db_pool().as_ref()).await?;Ok(())}pubfnvalidate_database_path(db_path:&str)->Result<()>{if db_path.is_empty(){bail!("DATABASE_URL is empty");}if db_path.starts_with("postgresql://")|| db_path.starts_with("postgres://"){returnOk(());}let path =Path::new(db_path);if!path.exists(){bail!("Database not found at '{db_path}'. Run setup first");}if!path.is_file(){bail!("Database path '{db_path}' exists but is not a file");}Ok(())}