diff --git a/server/src/http/workflow/mod.rs b/server/src/http/workflow/mod.rs index 7d71d452..083d03fb 100644 --- a/server/src/http/workflow/mod.rs +++ b/server/src/http/workflow/mod.rs @@ -344,47 +344,10 @@ pub fn validate_story_dirs( ) -> Result, String> { let mut results = Vec::new(); - // Validate from typed projection + content store. - { - let typed_items = crate::pipeline_state::read_all_typed(); - for item in typed_items { - use crate::pipeline_state::Stage; - if !matches!(item.stage, Stage::Backlog | Stage::Coding) { - continue; - } - let sid = item.story_id.0.clone(); - if let Some(content) = crate::db::read_content(&sid) { - match parse_front_matter(&content) { - Ok(meta) => { - let mut errors = Vec::new(); - if meta.name.is_none() { - errors.push("Missing 'name' field".to_string()); - } - if errors.is_empty() { - results.push(StoryValidationResult { - story_id: sid, - valid: true, - error: None, - }); - } else { - results.push(StoryValidationResult { - story_id: sid, - valid: false, - error: Some(errors.join("; ")), - }); - } - } - Err(e) => results.push(StoryValidationResult { - story_id: sid, - valid: false, - error: Some(e.to_string()), - }), - } - } - } - } - - // Filesystem fallback: also check work/ directories. + // Validate from filesystem shadows under the given root. + // NOTE: We intentionally read the filesystem here (not the global CRDT + // singleton) so that tests can pass an isolated tempdir and get + // deterministic results. See bug 525. let dirs_to_validate = vec![ root.join(".huskies").join("work").join("2_current"), root.join(".huskies").join("work").join("1_backlog"), @@ -409,11 +372,6 @@ pub fn validate_story_dirs( .unwrap_or_default() .to_string(); - // Skip if already validated from CRDT. - if results.iter().any(|r| r.story_id == story_id) { - continue; - } - let contents = std::fs::read_to_string(&path) .map_err(|e| format!("Failed to read {}: {e}", path.display()))?; match parse_front_matter(&contents) {