wip(929): stage 7 — drop resume_to_stage FS write from freeze/unfreeze
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) <noreply@anthropic.com>
This commit is contained in:
@@ -100,25 +100,18 @@ pub fn apply_transition_str(
|
|||||||
|
|
||||||
/// Freeze a story at its current stage.
|
/// Freeze a story at its current stage.
|
||||||
///
|
///
|
||||||
/// Transitions the story to `Stage::Frozen { resume_to: current_stage }` and
|
/// Story 929: the YAML write of `resume_to_stage` is gone; the projection
|
||||||
/// writes `resume_to_stage` into the front matter so the projection layer can
|
/// layer no longer reads it (defaults to Coding). Story 934 will make
|
||||||
/// reconstruct the full typed stage on subsequent reads.
|
/// 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<TransitionFired, ApplyError> {
|
pub fn transition_to_frozen(story_id: &str) -> Result<TransitionFired, ApplyError> {
|
||||||
let item = read_typed(story_id)?.ok_or_else(|| ApplyError::NotFound(story_id.to_string()))?;
|
apply_transition(story_id, PipelineEvent::Freeze, None)
|
||||||
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))
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// 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
|
/// Story 929: paired with `transition_to_frozen`, no longer touches YAML.
|
||||||
/// the `resume_to_stage` field from the front matter.
|
|
||||||
pub fn transition_to_unfrozen(story_id: &str) -> Result<TransitionFired, ApplyError> {
|
pub fn transition_to_unfrozen(story_id: &str) -> Result<TransitionFired, ApplyError> {
|
||||||
let transform = |content: &str| -> String {
|
apply_transition(story_id, PipelineEvent::Unfreeze, None)
|
||||||
crate::db::yaml_legacy::clear_front_matter_field_in_content(content, "resume_to_stage")
|
|
||||||
};
|
|
||||||
apply_transition(story_id, PipelineEvent::Unfreeze, Some(&transform))
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user