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:
@@ -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;
|
use std::collections::BTreeSet;
|
||||||
let mut items = BTreeSet::new();
|
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() {
|
for item in crate::pipeline_state::read_all_typed() {
|
||||||
if item.stage.dir_name() == stage_dir {
|
if item.stage.dir_name() == stage_dir {
|
||||||
items.insert(item.story_id.0.clone());
|
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()
|
items.into_iter().collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user