From 10d35176482f82dca08f49620a287eb6fdc0b1ee Mon Sep 17 00:00:00 2001 From: dave Date: Mon, 13 Apr 2026 18:14:58 +0000 Subject: [PATCH] fix: remove filesystem fallback from scan_stage_items to unblock 557 merge MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The auto-resolver kept both sides of the conflict — feature's _project_root signature with master's filesystem code referencing project_root — producing a compile error. Remove the filesystem fallback on master so there's no conflict. CRDT is the only source of truth. Co-Authored-By: Claude Opus 4.6 (1M context) --- server/src/agents/pool/auto_assign/scan.rs | 30 ++-------------------- 1 file changed, 2 insertions(+), 28 deletions(-) diff --git a/server/src/agents/pool/auto_assign/scan.rs b/server/src/agents/pool/auto_assign/scan.rs index 6f9be845..8390ed15 100644 --- a/server/src/agents/pool/auto_assign/scan.rs +++ b/server/src/agents/pool/auto_assign/scan.rs @@ -18,43 +18,17 @@ pub(in crate::agents::pool) fn is_agent_free( }) } -pub(super) fn scan_stage_items(project_root: &Path, stage_dir: &str) -> Vec { +pub(super) fn scan_stage_items(_project_root: &Path, stage_dir: &str) -> Vec { use std::collections::BTreeSet; let mut items = BTreeSet::new(); - // Include CRDT items via the typed projection — the primary source of truth. + // CRDT is the only source of truth — no filesystem fallback. for item in crate::pipeline_state::read_all_typed() { if item.stage.dir_name() == stage_dir { items.insert(item.story_id.0.clone()); } } - // Also include filesystem items (backwards compat / migration fallback). - // Skip any story the CRDT already tracks — its authoritative stage wins. - // Stale .md files in pipeline dirs (e.g. 1_backlog/) must not shadow an - // archived or otherwise-moved story in the CRDT. - let dir = project_root.join(".huskies").join("work").join(stage_dir); - if dir.is_dir() - && let Ok(entries) = std::fs::read_dir(&dir) - { - for entry in entries.flatten() { - let path = entry.path(); - if path.extension().and_then(|e| e.to_str()) == Some("md") - && let Some(stem) = path.file_stem().and_then(|s| s.to_str()) - { - // If the CRDT knows about this story (any stage), trust the CRDT. - if crate::pipeline_state::read_typed(stem) - .ok() - .flatten() - .is_some() - { - continue; - } - items.insert(stem.to_string()); - } - } - } - items.into_iter().collect() }