huskies: merge 960

This commit is contained in:
dave
2026-05-13 13:17:46 +00:00
parent a47fbc4179
commit 77dc09668c
14 changed files with 138 additions and 193 deletions
+12 -11
View File
@@ -3,6 +3,7 @@
use std::path::Path;
use crate::config::ProjectConfig;
use crate::pipeline_state::Stage;
use crate::slog;
use crate::slog_error;
@@ -25,13 +26,14 @@ impl AgentPool {
/// guards. Agent front-matter preferences and stage-mismatch fallback are handled
/// here as well.
pub(super) async fn assign_pipeline_stages(&self, project_root: &Path, config: &ProjectConfig) {
let stages: [(&str, PipelineStage); 2] = [
("2_current", PipelineStage::Coder),
("3_qa", PipelineStage::Qa),
let stages: [(Stage, PipelineStage); 2] = [
(Stage::Coding, PipelineStage::Coder),
(Stage::Qa, PipelineStage::Qa),
];
for (stage_dir, stage) in &stages {
let items = scan_stage_items(project_root, stage_dir);
for (pipeline_stage, stage) in &stages {
let stage_dir = pipeline_stage.dir_name();
let items = scan_stage_items(pipeline_stage);
if items.is_empty() {
continue;
}
@@ -39,23 +41,23 @@ impl AgentPool {
for story_id in &items {
// Items marked with review_hold (e.g. spikes after QA passes) stay
// in their current stage for human review — don't auto-assign agents.
if has_review_hold(project_root, stage_dir, story_id) {
if has_review_hold(story_id) {
continue;
}
// Skip frozen stories — pipeline advancement is suspended.
if is_story_frozen(project_root, stage_dir, story_id) {
if is_story_frozen(story_id) {
slog!("[auto-assign] Story '{story_id}' is frozen; skipping until unfrozen.");
continue;
}
// Skip blocked stories (retry limit exceeded).
if is_story_blocked(project_root, stage_dir, story_id) {
if is_story_blocked(story_id) {
continue;
}
// Skip stories whose dependencies haven't landed yet.
if has_unmet_dependencies(project_root, stage_dir, story_id) {
if has_unmet_dependencies(story_id) {
slog!(
"[auto-assign] Story '{story_id}' has unmet dependencies; skipping until deps are done."
);
@@ -64,8 +66,7 @@ impl AgentPool {
// Re-acquire the lock on each iteration to see state changes
// from previous start_agent calls in the same pass.
let preferred_agent =
read_story_front_matter_agent(project_root, stage_dir, story_id);
let preferred_agent = read_story_front_matter_agent(story_id);
// Check max_coders limit for the Coder stage before agent selection.
// If the pool is full, all remaining items in this stage wait.