fix: comment out premature db::crdt references that broke build

The 490 merge introduced references to a db::crdt module that doesn't
exist yet (it's part of story 491). Commented out with TODO(491)
markers so master compiles. The crdt_state.rs module from 490 is
intact — these are just the call sites that will be wired up when
491 lands.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dave
2026-04-07 23:49:11 +00:00
parent c4e70db85f
commit 753f7f1c92
4 changed files with 12 additions and 42 deletions
+2 -3
View File
@@ -65,9 +65,8 @@ fn move_item<'a>(
} }
} }
// Write the new stage through CRDT ops (also does legacy shadow write). // TODO(491): Wire up CRDT state transitions once the watcher story lands.
// Fire-and-forget; a missing database (e.g. in tests) is silently ignored. // crate::db::crdt::crdt_write(story_id, target_dir, &target_path);
crate::db::crdt::crdt_write(story_id, target_dir, &target_path);
slog!("[lifecycle] Moved '{story_id}' from work/{src_dir}/ to work/{target_dir}/"); slog!("[lifecycle] Moved '{story_id}' from work/{src_dir}/ to work/{target_dir}/");
Ok(Some(src_dir)) Ok(Some(src_dir))
-3
View File
@@ -1,6 +1,3 @@
#[allow(unexpected_cfgs)]
pub mod crdt;
/// SQLite shadow-write layer for pipeline state. /// SQLite shadow-write layer for pipeline state.
/// ///
/// All filesystem pipeline operations (move_story_to_X etc.) remain authoritative. /// All filesystem pipeline operations (move_story_to_X etc.) remain authoritative.
+4 -31
View File
@@ -215,41 +215,14 @@ fn load_stage_items(
) -> Result<Vec<UpcomingStory>, String> { ) -> Result<Vec<UpcomingStory>, String> {
let root = ctx.state.get_project_root()?; let root = ctx.state.get_project_root()?;
// Collect items already known from the CRDT layer so we can merge. // TODO(491): Merge CRDT layer items once the watcher story lands.
let crdt_items: HashMap<String, crate::db::crdt::PipelineItemState> =
if let Some(layer) = crate::db::crdt::get() {
layer
.items_for_stage(stage_dir)
.into_iter()
.collect()
} else {
HashMap::new()
};
// Always scan the filesystem to pick up items not yet in the CRDT // Scan the filesystem for pipeline items.
// (e.g. items created by other tools or manual file edits).
let dir = root.join(".huskies").join("work").join(stage_dir); let dir = root.join(".huskies").join("work").join(stage_dir);
let mut seen = std::collections::HashSet::new(); let mut seen: std::collections::HashSet<String> = std::collections::HashSet::new();
let mut stories = Vec::new(); let mut stories = Vec::new();
// First, add items from CRDT. // TODO(491): Add CRDT items once the watcher story lands.
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::<Vec<u32>>(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,
});
}
// Then, add filesystem items not in the CRDT (backwards compat). // Then, add filesystem items not in the CRDT (backwards compat).
if dir.exists() { if dir.exists() {
+6 -5
View File
@@ -311,11 +311,12 @@ async fn main() -> Result<(), std::io::Error> {
.unwrap() .unwrap()
.as_ref() .as_ref()
.map(|root| root.join(".huskies").join("pipeline.db")); .map(|root| root.join(".huskies").join("pipeline.db"));
if let Some(db_path) = crdt_db_path // TODO(491): Initialise CRDT state layer once the watcher story lands.
&& let Err(e) = db::crdt::init(&db_path).await // 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}"); // {
} // slog!("[crdt] Failed to initialise CRDT state layer: {e}");
// }
let workflow = Arc::new(std::sync::Mutex::new(WorkflowState::default())); let workflow = Arc::new(std::sync::Mutex::new(WorkflowState::default()));