huskies: merge 520_story_typed_pipeline_state_machine_in_rust_foundation_replaces_stringly_typed_crdt_views_with_strict_enums_subsumes_436
This commit is contained in:
@@ -23,18 +23,15 @@ impl AgentPool {
|
||||
/// Return the active pipeline stage directory name for `story_id`, or `None` if the
|
||||
/// story is not in any active stage (`2_current/`, `3_qa/`, `4_merge/`).
|
||||
pub(super) fn find_active_story_stage(project_root: &Path, story_id: &str) -> Option<&'static str> {
|
||||
const STAGES: [&str; 3] = ["2_current", "3_qa", "4_merge"];
|
||||
|
||||
// Try CRDT first — primary source of truth.
|
||||
if let Some(item) = crate::crdt_state::read_item(story_id) {
|
||||
for stage in &STAGES {
|
||||
if item.stage == *stage {
|
||||
return Some(stage);
|
||||
}
|
||||
}
|
||||
// Try typed CRDT projection first — primary source of truth.
|
||||
if let Ok(Some(item)) = crate::pipeline_state::read_typed(story_id)
|
||||
&& item.stage.is_active()
|
||||
{
|
||||
return Some(item.stage.dir_name());
|
||||
}
|
||||
|
||||
// Also check filesystem (backwards compat / tests).
|
||||
const STAGES: [&str; 3] = ["2_current", "3_qa", "4_merge"];
|
||||
for stage in &STAGES {
|
||||
let path = project_root
|
||||
.join(".huskies")
|
||||
|
||||
Reference in New Issue
Block a user