huskies: merge 557_refactor_remove_all_filesystem_fallback_paths_crdt_is_the_only_source_of_truth

This commit is contained in:
dave
2026-04-14 09:10:14 +00:00
parent 10d3517648
commit 979cf39228
5 changed files with 67 additions and 88 deletions
@@ -300,15 +300,15 @@ mod tests {
async fn auto_assign_picks_up_story_queued_in_current() {
let tmp = tempfile::tempdir().unwrap();
let sk = tmp.path().join(".huskies");
let current = sk.join("work/2_current");
std::fs::create_dir_all(&current).unwrap();
std::fs::create_dir_all(&sk).unwrap();
std::fs::write(
sk.join("project.toml"),
"[[agent]]\nname = \"coder-1\"\nstage = \"coder\"\n",
)
.unwrap();
// Place the story in 2_current/ (simulating the "queued" state).
std::fs::write(current.join("story-3.md"), "---\nname: Story 3\n---\n").unwrap();
// Place the story in 2_current/ via CRDT (the only source of truth).
crate::db::ensure_content_store();
crate::db::write_item_with_content("story-3", "2_current", "---\nname: Story 3\n---\n");
let pool = AgentPool::new_test(3001);
// No agents are running — coder-1 is free.
@@ -549,23 +549,22 @@ mod tests {
let tmp = tempfile::tempdir().unwrap();
let root = tmp.path();
let sk = root.join(".huskies");
let current = sk.join("work/2_current");
let done = sk.join("work/5_done");
std::fs::create_dir_all(&current).unwrap();
std::fs::create_dir_all(&done).unwrap();
std::fs::create_dir_all(&sk).unwrap();
std::fs::write(
sk.join("project.toml"),
"[[agent]]\nname = \"coder-1\"\nstage = \"coder\"\n",
)
.unwrap();
// Seed stories via CRDT (the only source of truth).
crate::db::ensure_content_store();
// Dep 999 is now done.
std::fs::write(done.join("999_story_dep.md"), "---\nname: Dep\n---\n").unwrap();
crate::db::write_item_with_content("999_story_dep", "5_done", "---\nname: Dep\n---\n");
// Story 10 depends on 999 which is done.
std::fs::write(
current.join("10_story_unblocked.md"),
crate::db::write_item_with_content(
"10_story_unblocked",
"2_current",
"---\nname: Unblocked\ndepends_on: [999]\n---\n",
)
.unwrap();
);
let pool = AgentPool::new_test(3001);
pool.auto_assign_available_work(root).await;
+14 -18
View File
@@ -690,14 +690,9 @@ mod tests {
let tmp = tempfile::tempdir().unwrap();
let root = tmp.path();
// Set up story in 2_current/
let current = root.join(".huskies/work/2_current");
fs::create_dir_all(&current).unwrap();
fs::write(current.join("173_story_test.md"), "test").unwrap();
// Ensure 3_qa/ exists for the move target
fs::create_dir_all(root.join(".huskies/work/3_qa")).unwrap();
// Ensure 1_backlog/ exists (start_agent calls move_story_to_current)
fs::create_dir_all(root.join(".huskies/work/1_backlog")).unwrap();
// 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");
// Write a project.toml with a qa agent so start_agent can resolve it.
fs::create_dir_all(root.join(".huskies")).unwrap();
@@ -880,8 +875,7 @@ stage = "qa"
let root = tmp.path();
let sk = root.join(".huskies");
let qa_dir = sk.join("work/3_qa");
fs::create_dir_all(&qa_dir).unwrap();
fs::create_dir_all(&sk).unwrap();
// Configure a single QA agent.
fs::write(
@@ -894,19 +888,21 @@ stage = "qa"
)
.unwrap();
// Seed stories via CRDT (the only source of truth).
crate::db::ensure_content_store();
// Story 292 is in QA with QA agent running (will "complete" via
// run_pipeline_advance below). Story 293 is in QA with NO agent —
// simulating the "stuck" state from bug 295.
fs::write(
qa_dir.join("292_story_first.md"),
crate::db::write_item_with_content(
"292_story_first",
"3_qa",
"---\nname: First\nqa: human\n---\n",
)
.unwrap();
fs::write(
qa_dir.join("293_story_second.md"),
);
crate::db::write_item_with_content(
"293_story_second",
"3_qa",
"---\nname: Second\nqa: human\n---\n",
)
.unwrap();
);
let pool = AgentPool::new_test(3001);
// QA is currently running on story 292.