huskies: merge 489_story_sqlite_shadow_write_for_pipeline_state_via_sqlx

This commit is contained in:
dave
2026-04-07 13:09:48 +00:00
parent 0c9e120ba2
commit f1ef31d1ee
7 changed files with 815 additions and 1 deletions
+16
View File
@@ -6,6 +6,7 @@ mod agent_log;
mod agents;
mod chat;
mod config;
mod db;
mod http;
mod io;
mod llm;
@@ -282,6 +283,21 @@ async fn main() -> Result<(), std::io::Error> {
log_buffer::global().set_log_file(log_dir.join("server.log"));
}
// Initialise the SQLite pipeline shadow-write database.
// Clone the path out before the await so we don't hold the MutexGuard across
// an await point.
let pipeline_db_path = app_state
.project_root
.lock()
.unwrap()
.as_ref()
.map(|root| root.join(".huskies").join("pipeline.db"));
if let Some(db_path) = pipeline_db_path
&& let Err(e) = db::init(&db_path).await
{
slog!("[db] Failed to initialise pipeline.db: {e}");
}
let workflow = Arc::new(std::sync::Mutex::new(WorkflowState::default()));
// Filesystem watcher: broadcast channel for work/ pipeline changes.