huskies: merge 985

This commit is contained in:
dave
2026-05-13 16:47:56 +00:00
parent 580480094e
commit a078d3df7c
3 changed files with 107 additions and 1 deletions
@@ -248,3 +248,70 @@ stage = "qa"
(bug 173: lozenges must update when agents are assigned during pipeline advance)"
);
}
#[tokio::test]
async fn pipeline_advance_coder_gates_pass_human_qa_holds_for_review() {
use std::fs;
let tmp = tempfile::tempdir().unwrap();
let root = tmp.path();
// Seed story via CRDT so qa_mode can be resolved from the store.
crate::db::ensure_content_store();
crate::db::write_item_with_content(
"9910_story_human_qa",
"2_current",
"---\nname: Human Qa Test\n---\ntest",
crate::db::ItemMeta::named("Human Qa Test"),
);
// Set qa_mode = Human on the CRDT item directly.
crate::crdt_state::set_qa_mode(
"9910_story_human_qa",
Some(crate::io::story_metadata::QaMode::Human),
);
// Write a minimal project.toml so the pool can load config.
fs::create_dir_all(root.join(".huskies")).unwrap();
fs::write(
root.join(".huskies/project.toml"),
r#"
[[agent]]
name = "coder-1"
role = "Coder"
command = "echo"
args = ["noop"]
prompt = "test"
stage = "coder"
"#,
)
.unwrap();
let pool = AgentPool::new_test(3001);
pool.run_pipeline_advance(
"9910_story_human_qa",
"coder-1",
CompletionReport {
summary: "done".to_string(),
gates_passed: true,
gate_output: String::new(),
needs_commit_recovery: false,
},
Some(root.to_path_buf()),
None,
false,
None,
)
.await;
// With qa: human the story should be held for human review (ReviewHold stage).
let item = crate::crdt_state::read_item("9910_story_human_qa")
.expect("story should exist in CRDT after advance");
assert!(
matches!(
item.stage(),
crate::pipeline_state::Stage::ReviewHold { .. }
),
"qa: human should leave story in ReviewHold, got: {:?}",
item.stage()
);
}