huskies: merge 530_story_eliminate_filesystem_markdown_shadows_entirely_crdt_db_is_the_only_story_store

This commit is contained in:
dave
2026-04-10 14:56:13 +00:00
parent 1dd675796b
commit 11d19d8902
26 changed files with 966 additions and 1668 deletions
+20 -23
View File
@@ -92,13 +92,7 @@ impl AgentPool {
// honour `agent: coder-opus` written by the `assign` command — mirroring
// the auto_assign path (bug 379).
let front_matter_agent: Option<String> = if agent_name.is_none() {
find_active_story_stage(project_root, story_id).and_then(|stage_dir| {
let path = project_root
.join(".huskies")
.join("work")
.join(stage_dir)
.join(format!("{story_id}.md"));
let contents = std::fs::read_to_string(path).ok()?;
crate::db::read_content(story_id).and_then(|contents| {
crate::io::story_metadata::parse_front_matter(&contents).ok()?.agent
})
} else {
@@ -1218,11 +1212,12 @@ stage = "coder"
[[agent]]\nname = \"mergemaster\"\nstage = \"mergemaster\"\n",
)
.unwrap();
fs::write(
sk_dir.join("work/2_current/310_story_foo.md"),
crate::db::ensure_content_store();
crate::db::write_item_with_content(
"310_story_foo",
"2_current",
"---\nname: Foo\n---\n",
)
.unwrap();
);
let pool = AgentPool::new_test(3099);
let result = pool
@@ -1248,22 +1243,23 @@ stage = "coder"
let root = tmp.path();
let sk_dir = root.join(".huskies");
fs::create_dir_all(sk_dir.join("work/3_qa")).unwrap();
fs::create_dir_all(&sk_dir).unwrap();
fs::write(
sk_dir.join("project.toml"),
"[[agent]]\nname = \"coder-1\"\nstage = \"coder\"\n\n\
[[agent]]\nname = \"qa\"\nstage = \"qa\"\n",
)
.unwrap();
fs::write(
sk_dir.join("work/3_qa/42_story_bar.md"),
"---\nname: Bar\n---\n",
)
.unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content(
"8842_story_qa_guard",
"3_qa",
"---\nname: QA Guard\n---\n",
);
let pool = AgentPool::new_test(3099);
let result = pool
.start_agent(root, "42_story_bar", Some("coder-1"), None)
.start_agent(root, "8842_story_qa_guard", Some("coder-1"), None)
.await;
assert!(
@@ -1285,18 +1281,19 @@ stage = "coder"
let root = tmp.path();
let sk_dir = root.join(".huskies");
fs::create_dir_all(sk_dir.join("work/4_merge")).unwrap();
fs::create_dir_all(&sk_dir).unwrap();
fs::write(
sk_dir.join("project.toml"),
"[[agent]]\nname = \"qa\"\nstage = \"qa\"\n\n\
[[agent]]\nname = \"mergemaster\"\nstage = \"mergemaster\"\n",
)
.unwrap();
fs::write(
sk_dir.join("work/4_merge/55_story_baz.md"),
crate::db::ensure_content_store();
crate::db::write_item_with_content(
"55_story_baz",
"4_merge",
"---\nname: Baz\n---\n",
)
.unwrap();
);
let pool = AgentPool::new_test(3099);
let result = pool