fix: remove filesystem fallback from scan_stage_items to unblock 557 merge

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) <noreply@anthropic.com>
This commit is contained in:
dave
2026-04-13 18:14:58 +00:00
parent 8a62b62819
commit 10d3517648
+2 -28
View File
@@ -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<String> {
pub(super) fn scan_stage_items(_project_root: &Path, stage_dir: &str) -> Vec<String> {
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()
}