diff --git a/server/src/pipeline_state/apply.rs b/server/src/pipeline_state/apply.rs index 2c877433..429d4d5a 100644 --- a/server/src/pipeline_state/apply.rs +++ b/server/src/pipeline_state/apply.rs @@ -100,25 +100,18 @@ pub fn apply_transition_str( /// Freeze a story at its current stage. /// -/// Transitions the story to `Stage::Frozen { resume_to: current_stage }` and -/// writes `resume_to_stage` into the front matter so the projection layer can -/// reconstruct the full typed stage on subsequent reads. +/// Story 929: the YAML write of `resume_to_stage` is gone; the projection +/// layer no longer reads it (defaults to Coding). Story 934 will make +/// frozen a flag orthogonal to Stage, so the story stays in its current +/// Stage rather than encoding a "where to resume" payload — at which point +/// the read-side default also becomes moot. pub fn transition_to_frozen(story_id: &str) -> Result { - let item = read_typed(story_id)?.ok_or_else(|| ApplyError::NotFound(story_id.to_string()))?; - let resume_dir = item.stage.dir_name().to_string(); - let transform = move |content: &str| -> String { - crate::db::yaml_legacy::set_front_matter_field(content, "resume_to_stage", &resume_dir) - }; - apply_transition(story_id, PipelineEvent::Freeze, Some(&transform)) + apply_transition(story_id, PipelineEvent::Freeze, None) } -/// Unfreeze a story, restoring it to the stage it was in before freezing. +/// Unfreeze a story. /// -/// Transitions `Stage::Frozen { resume_to }` back to `resume_to` and removes -/// the `resume_to_stage` field from the front matter. +/// Story 929: paired with `transition_to_frozen`, no longer touches YAML. pub fn transition_to_unfrozen(story_id: &str) -> Result { - let transform = |content: &str| -> String { - crate::db::yaml_legacy::clear_front_matter_field_in_content(content, "resume_to_stage") - }; - apply_transition(story_id, PipelineEvent::Unfreeze, Some(&transform)) + apply_transition(story_id, PipelineEvent::Unfreeze, None) }