huskies: merge 864

This commit is contained in:
dave
2026-04-30 22:23:21 +00:00
parent 3911c24c26
commit 61cf7684de
41 changed files with 540 additions and 71 deletions
@@ -88,7 +88,12 @@ pub(super) fn write_review_hold_to_store(story_id: &str) {
.flatten()
.map(|i| i.stage.dir_name().to_string())
.unwrap_or_else(|| "3_qa".to_string());
crate::db::write_item_with_content(story_id, &stage, &updated);
crate::db::write_item_with_content(
story_id,
&stage,
&updated,
crate::db::ItemMeta::from_yaml(&updated),
);
} else {
slog_error!("[pipeline] Cannot write review_hold for '{story_id}': no content in store");
}
@@ -172,7 +172,12 @@ async fn pipeline_advance_sends_agent_state_changed_to_watcher_tx() {
// Seed story via CRDT (the only source of truth).
crate::db::ensure_content_store();
crate::db::write_item_with_content("173_story_test", "2_current", "---\nname: test\n---\n");
crate::db::write_item_with_content(
"173_story_test",
"2_current",
"---\nname: test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: test\n---\n"),
);
// Write a project.toml with a qa agent so start_agent can resolve it.
fs::create_dir_all(root.join(".huskies")).unwrap();
@@ -51,6 +51,7 @@ async fn mergemaster_blocks_and_sends_story_blocked_when_no_commits_ahead() {
"9919_story_no_commits",
"2_current",
"---\nname: Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Test\n---\n"),
);
let pool = AgentPool::new_test(3001);
@@ -145,11 +146,13 @@ stage = "qa"
"292_story_first",
"3_qa",
"---\nname: First\nqa: human\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: First\nqa: human\n---\n"),
);
crate::db::write_item_with_content(
"293_story_second",
"3_qa",
"---\nname: Second\nqa: human\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Second\nqa: human\n---\n"),
);
let pool = AgentPool::new_test(3001);
@@ -245,7 +248,12 @@ async fn stale_mergemaster_advance_for_done_story_is_noop() {
let story_id = "9929_story_zombie_merge";
let content = "---\nname: Zombie Merge Test\n---\n";
crate::db::write_content(story_id, content);
crate::db::write_item_with_content(story_id, "5_done", content);
crate::db::write_item_with_content(
story_id,
"5_done",
content,
crate::db::ItemMeta::from_yaml(content),
);
let pool = AgentPool::new_test(3001);
let mut rx = pool.watcher_tx.subscribe();
@@ -381,6 +389,7 @@ async fn work_survived_advances_to_qa_instead_of_blocking() {
"9945_story_survived",
"2_current",
"---\nname: Survived Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Survived Test\n---\n"),
);
// Simulate a passing run_tests call during the agent's session (bug 668):
@@ -474,6 +483,7 @@ async fn no_committed_work_still_retries_and_blocks() {
"9946_story_nowork",
"2_current",
"---\nname: No Work Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: No Work Test\n---\n"),
);
// Write a project.toml with max_retries = 1.
@@ -601,6 +611,7 @@ async fn gates_failed_no_test_evidence_does_not_advance() {
"9947_story_no_evidence",
"2_current",
"---\nname: No Evidence Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: No Evidence Test\n---\n"),
);
// Explicitly ensure no test evidence exists for this story.
@@ -730,6 +741,7 @@ async fn gates_failed_with_test_evidence_and_committed_work_advances() {
"9948_story_with_evidence",
"2_current",
"---\nname: With Evidence Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: With Evidence Test\n---\n"),
);
// Write the run_tests evidence — simulates the agent having called run_tests
@@ -813,6 +825,7 @@ stage = "coder"
"9950_story_warm_resume",
"2_current",
"---\nname: Warm Resume Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Warm Resume Test\n---\n"),
);
let pool = AgentPool::new_test(3001);
@@ -651,6 +651,7 @@ async fn server_side_merge_happy_path_advances_to_done() {
"757a_happy",
"4_merge",
"---\nname: Happy path test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Happy path test\n---\n"),
);
let pool = Arc::new(AgentPool::new_test(3001));
@@ -787,6 +788,7 @@ async fn server_side_merge_conflict_sets_merge_failure() {
"757b_conflict",
"4_merge",
"---\nname: Conflict test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Conflict test\n---\n"),
);
let pool = Arc::new(AgentPool::new_test(3001));
@@ -898,6 +900,7 @@ async fn server_side_merge_gate_failure_sets_merge_failure() {
"757c_gates",
"4_merge",
"---\nname: Gate failure test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: Gate failure test\n---\n"),
);
let pool = Arc::new(AgentPool::new_test(3001));