huskies: merge 959
This commit is contained in:
@@ -385,8 +385,11 @@ pub fn move_story_to_stage(story_id: &str, target_stage: &str) -> Result<(String
|
||||
let item = read_typed_or_err(story_id)?;
|
||||
let from_name = stage_to_name(&item.stage);
|
||||
|
||||
// Idempotent: already in the target stage.
|
||||
if item.stage.dir_name() == target_wire {
|
||||
// Idempotent: already in the target stage. Compare via Stage discriminant
|
||||
// so the check is typed rather than a raw string equality.
|
||||
let already_there = Stage::from_dir(target_wire)
|
||||
.is_some_and(|t| std::mem::discriminant(&item.stage) == std::mem::discriminant(&t));
|
||||
if already_there {
|
||||
return Ok((target_stage.to_string(), target_stage.to_string()));
|
||||
}
|
||||
|
||||
|
||||
@@ -40,11 +40,10 @@ pub(super) fn scan_stage_items(_project_root: &Path, stage_dir: &str) -> Vec<Str
|
||||
let Some(want) = crate::pipeline_state::Stage::from_dir(normalised) else {
|
||||
return Vec::new();
|
||||
};
|
||||
let want = want.dir_name();
|
||||
|
||||
// CRDT is the only source of truth — no filesystem fallback.
|
||||
for item in crate::pipeline_state::read_all_typed() {
|
||||
if item.stage.dir_name() == want {
|
||||
if std::mem::discriminant(&item.stage) == std::mem::discriminant(&want) {
|
||||
items.insert(item.story_id.0.clone());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user