huskies: merge 945

This commit is contained in:
dave
2026-05-13 06:05:01 +00:00
parent 3a8894ea8f
commit 9ce5a8df0c
53 changed files with 497 additions and 654 deletions
+7 -21
View File
@@ -100,31 +100,17 @@ pub fn apply_transition_str(
/// Freeze a story.
///
/// Story 934, stage 4: `frozen` is now a CRDT flag orthogonal to [`Stage`],
/// so the story stays at its current stage and only the boolean register
/// changes. Returns `Err(NotFound)` if no item exists for `story_id`.
/// Story 945: `Stage::Frozen { resume_to }` is the single source of truth;
/// the previous `frozen: bool` flag has been removed. Transitions any
/// non-terminal stage to `Stage::Frozen { resume_to: <previous stage> }`.
pub fn transition_to_frozen(story_id: &str) -> Result<(), ApplyError> {
if read_typed(story_id)?.is_none() {
return Err(ApplyError::NotFound(story_id.to_string()));
}
crate::crdt_state::set_frozen(story_id, true);
crate::slog!("[pipeline/transition] #{}: Freeze (flag set)", story_id);
Ok(())
apply_transition(story_id, PipelineEvent::Freeze, None).map(|_| ())
}
/// Unfreeze a story.
///
/// Story 934, stage 4: paired with [`transition_to_frozen`]; clears the
/// CRDT `frozen` flag without touching the stage register. Returns
/// `Err(NotFound)` if no item exists for `story_id`.
/// Story 945: returns the story to the `resume_to` stage stored on
/// `Stage::Frozen`.
pub fn transition_to_unfrozen(story_id: &str) -> Result<(), ApplyError> {
if read_typed(story_id)?.is_none() {
return Err(ApplyError::NotFound(story_id.to_string()));
}
crate::crdt_state::set_frozen(story_id, false);
crate::slog!(
"[pipeline/transition] #{}: Unfreeze (flag cleared)",
story_id
);
Ok(())
apply_transition(story_id, PipelineEvent::Unfreeze, None).map(|_| ())
}