huskies: merge 984

This commit is contained in:
dave
2026-05-13 16:43:19 +00:00
parent c3c9db3d8b
commit 580480094e
25 changed files with 501 additions and 97 deletions
+24
View File
@@ -111,6 +111,30 @@ pub fn set_resume_to(story_id: &str, stage: &Stage) -> bool {
true
}
/// Set the `resume_to` CRDT register to an arbitrary raw string.
///
/// Story 984: reuses `resume_to` to carry metadata for `Superseded`
/// (`superseded_by` story ID) and `Rejected` (`reason` string). These
/// stages never have a resume target, so the register is exclusively
/// available for their metadata.
///
/// Returns `true` if the item was found and the op was applied.
pub fn set_resume_to_raw(story_id: &str, value: &str) -> bool {
let Some(state_mutex) = get_crdt() else {
return false;
};
let Ok(mut state) = state_mutex.lock() else {
return false;
};
let Some(&idx) = state.index.get(story_id) else {
return false;
};
apply_and_persist(&mut state, |s| {
s.crdt.doc.items[idx].resume_to.set(value.to_string())
});
true
}
/// Set the `name` field for a pipeline item by its story ID.
///
/// `Some(name)` writes the human-readable name into the CRDT register.
+1 -1
View File
@@ -11,7 +11,7 @@ mod tests;
pub use item::{
bump_retry_count, set_agent, set_depends_on, set_epic, set_item_type, set_name, set_qa_mode,
set_resume_to, set_retry_count, write_item,
set_resume_to, set_resume_to_raw, set_retry_count, write_item,
};
#[cfg(test)]