From 23f58f576261da8acebbb32958f3c38873b91f41 Mon Sep 17 00:00:00 2001 From: Timmy Date: Tue, 12 May 2026 19:18:27 +0100 Subject: [PATCH] =?UTF-8?q?wip(929):=20stage=207=20=E2=80=94=20drop=20resu?= =?UTF-8?q?me=5Fto=5Fstage=20FS=20write=20from=20freeze/unfreeze?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit transition_to_frozen and transition_to_unfrozen no longer touch YAML; both now just call apply_transition with no content_transform. Pairs with the stage-6 read-side change in projection.rs. Story 934 will obviate the entire resume_to mechanism by making frozen a flag orthogonal to Stage (story stays in its current Stage when frozen). Co-Authored-By: Claude Opus 4.7 (1M context) --- server/src/pipeline_state/apply.rs | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) 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) }