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
+11 -9
View File
@@ -192,11 +192,12 @@ pub fn move_story_to_qa(story_id: &str) -> Result<(), String> {
.map_err(|e| e.to_string())
}
/// Move a story from `work/3_qa/` back to `work/2_current/`, clearing
/// `review_hold` (story 932: CRDT register) and appending rejection notes.
/// Move a story from `work/3_qa/` back to `work/2_current/`, appending
/// rejection notes. Story 945: the legacy `review_hold` flag is gone; if a
/// story is in `Stage::ReviewHold`, the `GatesFailed` event simply fails to
/// transition, which is the correct behaviour (you cannot reject from QA a
/// story that is currently parked in review hold).
pub fn reject_story_from_qa(story_id: &str, notes: &str) -> Result<(), String> {
crate::crdt_state::set_review_hold(story_id, false);
if notes.is_empty() {
apply_transition(
story_id,
@@ -292,11 +293,9 @@ pub fn transition_to_unblocked(story_id: &str) -> Result<(), String> {
.map(|_| ())
.map_err(|e| e.to_string())?;
// Reset CRDT registers so the legacy `blocked`/`retry_count` fields match
// the new typed stage. Pre-865, YAML stripping kept these in sync as a
// side-effect of the content_transform above; post-865 the content has no
// YAML, so we must clear the registers explicitly.
crate::crdt_state::set_blocked(story_id, false);
// Story 945: the legacy `blocked` boolean flag is gone — `Stage::Blocked`
// is the single source of truth. We still reset `retry_count` so a fresh
// attempt at the resumed stage starts at zero.
crate::crdt_state::set_retry_count(story_id, 0);
Ok(())
}
@@ -428,6 +427,9 @@ fn stage_to_name(s: &Stage) -> &'static str {
Stage::Qa => "qa",
Stage::Merge { .. } => "merge",
Stage::MergeFailure { .. } => "merge_failure",
Stage::MergeFailureFinal { .. } => "merge_failure_final",
Stage::Frozen { .. } => "frozen",
Stage::ReviewHold { .. } => "review_hold",
Stage::Done { .. } => "done",
Stage::Archived { .. } => "archived",
}