huskies: merge 867

This commit is contained in:
dave
2026-04-29 22:12:23 +00:00
parent e56bd2d834
commit a49f668b5a
17 changed files with 286 additions and 61 deletions
+9 -8
View File
@@ -22,6 +22,8 @@ pub(super) struct FrontMatter {
pub depends_on: Option<Vec<u32>>,
/// When `true`, the story is frozen.
pub frozen: Option<bool>,
/// Stage directory to restore on unfreeze (e.g. `"2_current"`).
pub resume_to_stage: Option<String>,
/// Set to `true` when an agent's `run_tests` call returns `passed=true`.
/// Used by the bug-645 salvage path to distinguish a genuine test-passing
/// session from one that merely compiled.
@@ -76,6 +78,7 @@ fn build_metadata(front: FrontMatter) -> StoryMetadata {
blocked: front.blocked,
depends_on: front.depends_on,
frozen: front.frozen,
resume_to_stage: front.resume_to_stage,
run_tests_passed: front.run_tests_passed,
item_type: front.item_type,
mergemaster_attempted: front.mergemaster_attempted,
@@ -131,17 +134,15 @@ pub fn resolve_qa_mode_from_content(story_id: &str, contents: &str, default: QaM
}
}
/// Return `true` if the story has `frozen: true` in the content store.
/// Return `true` if the story is in the `Frozen` pipeline stage.
///
/// Used by the pipeline advance code to suppress stage transitions for frozen stories.
/// Checks the typed CRDT stage via `read_typed`. Used by the pipeline advance
/// code to suppress stage transitions for frozen stories.
pub fn is_story_frozen_in_store(story_id: &str) -> bool {
let contents = match crate::db::read_content(story_id) {
Some(c) => c,
None => return false,
};
parse_front_matter(&contents)
crate::pipeline_state::read_typed(story_id)
.ok()
.and_then(|m| m.frozen)
.flatten()
.map(|item| item.stage.is_frozen())
.unwrap_or(false)
}
+3
View File
@@ -59,6 +59,9 @@ pub struct StoryMetadata {
/// When `true`, the story is frozen: auto-assign skips it, the pipeline
/// does not advance it, and no mergemaster is spawned.
pub frozen: Option<bool>,
/// Pipeline stage to restore when unfreezing (e.g. `"2_current"`).
/// Written by `transition_to_frozen`; cleared by `transition_to_unfrozen`.
pub resume_to_stage: Option<String>,
/// Set to `true` when an agent's `run_tests` call returns `passed=true`.
/// Used by the bug-645 salvage path to require real test evidence, not just
/// compilation success.
+1
View File
@@ -56,6 +56,7 @@ pub fn stage_metadata(stage: &str, item_id: &str) -> Option<(&'static str, Strin
Stage::Merge { .. } => ("merge", format!("huskies: queue {item_id} for merge")),
Stage::Done { .. } => ("done", format!("huskies: done {item_id}")),
Stage::Archived { .. } => ("accept", format!("huskies: accept {item_id}")),
Stage::Frozen { .. } => ("freeze", format!("huskies: freeze {item_id}")),
};
Some((action, msg))
}