diff --git a/server/src/agents/lifecycle.rs b/server/src/agents/lifecycle.rs index 6fd7acc4..c6f75149 100644 --- a/server/src/agents/lifecycle.rs +++ b/server/src/agents/lifecycle.rs @@ -65,9 +65,8 @@ fn move_item<'a>( } } - // Write the new stage through CRDT ops (also does legacy shadow write). - // Fire-and-forget; a missing database (e.g. in tests) is silently ignored. - crate::db::crdt::crdt_write(story_id, target_dir, &target_path); + // TODO(491): Wire up CRDT state transitions once the watcher story lands. + // crate::db::crdt::crdt_write(story_id, target_dir, &target_path); slog!("[lifecycle] Moved '{story_id}' from work/{src_dir}/ to work/{target_dir}/"); Ok(Some(src_dir)) diff --git a/server/src/db/mod.rs b/server/src/db/mod.rs index 0ed11628..607be1dc 100644 --- a/server/src/db/mod.rs +++ b/server/src/db/mod.rs @@ -1,6 +1,3 @@ -#[allow(unexpected_cfgs)] -pub mod crdt; - /// SQLite shadow-write layer for pipeline state. /// /// All filesystem pipeline operations (move_story_to_X etc.) remain authoritative. diff --git a/server/src/http/workflow/mod.rs b/server/src/http/workflow/mod.rs index ba079bc1..7cf1058c 100644 --- a/server/src/http/workflow/mod.rs +++ b/server/src/http/workflow/mod.rs @@ -215,41 +215,14 @@ fn load_stage_items( ) -> Result, String> { let root = ctx.state.get_project_root()?; - // Collect items already known from the CRDT layer so we can merge. - let crdt_items: HashMap = - if let Some(layer) = crate::db::crdt::get() { - layer - .items_for_stage(stage_dir) - .into_iter() - .collect() - } else { - HashMap::new() - }; + // TODO(491): Merge CRDT layer items once the watcher story lands. - // Always scan the filesystem to pick up items not yet in the CRDT - // (e.g. items created by other tools or manual file edits). + // Scan the filesystem for pipeline items. let dir = root.join(".huskies").join("work").join(stage_dir); - let mut seen = std::collections::HashSet::new(); + let mut seen: std::collections::HashSet = std::collections::HashSet::new(); let mut stories = Vec::new(); - // First, add items from CRDT. - for (story_id, item) in &crdt_items { - seen.insert(story_id.clone()); - let depends_on = item.depends_on.as_ref().and_then(|d| serde_json::from_str::>(d).ok()); - let agent = agent_map.get(story_id).cloned(); - stories.push(UpcomingStory { - story_id: story_id.clone(), - name: item.name.clone(), - error: None, - merge_failure: item.merge_failure.clone(), - agent, - review_hold: item.review_hold, - qa: item.qa.clone(), - retry_count: item.retry_count.map(|r| r as u32), - blocked: item.blocked, - depends_on, - }); - } + // TODO(491): Add CRDT items once the watcher story lands. // Then, add filesystem items not in the CRDT (backwards compat). if dir.exists() { diff --git a/server/src/main.rs b/server/src/main.rs index d17cfff8..f798162a 100644 --- a/server/src/main.rs +++ b/server/src/main.rs @@ -311,11 +311,12 @@ async fn main() -> Result<(), std::io::Error> { .unwrap() .as_ref() .map(|root| root.join(".huskies").join("pipeline.db")); - if let Some(db_path) = crdt_db_path - && let Err(e) = db::crdt::init(&db_path).await - { - slog!("[crdt] Failed to initialise CRDT state layer: {e}"); - } + // TODO(491): Initialise CRDT state layer once the watcher story lands. + // if let Some(db_path) = crdt_db_path + // && let Err(e) = db::crdt::init(&db_path).await + // { + // slog!("[crdt] Failed to initialise CRDT state layer: {e}"); + // } let workflow = Arc::new(std::sync::Mutex::new(WorkflowState::default()));