huskies: merge 530_story_eliminate_filesystem_markdown_shadows_entirely_crdt_db_is_the_only_story_store
This commit is contained in:
@@ -80,7 +80,7 @@ pub async fn handle_start(
|
||||
agents: &AgentPool,
|
||||
) -> String {
|
||||
// Find the story by numeric prefix: CRDT → content store → filesystem.
|
||||
let (story_id, _stage_dir, path, content) =
|
||||
let (story_id, _stage_dir, _path, content) =
|
||||
match crate::chat::lookup::find_story_by_number(project_root, story_number) {
|
||||
Some(found) => found,
|
||||
None => {
|
||||
@@ -91,7 +91,6 @@ pub async fn handle_start(
|
||||
};
|
||||
|
||||
let story_name = content
|
||||
.or_else(|| std::fs::read_to_string(&path).ok())
|
||||
.and_then(|contents| {
|
||||
crate::io::story_metadata::parse_front_matter(&contents)
|
||||
.ok()
|
||||
@@ -252,23 +251,25 @@ mod tests {
|
||||
let tmp = tempfile::tempdir().unwrap();
|
||||
let project_root = tmp.path();
|
||||
let sk = project_root.join(".huskies");
|
||||
let backlog = sk.join("work/1_backlog");
|
||||
std::fs::create_dir_all(&backlog).unwrap();
|
||||
std::fs::create_dir_all(&sk).unwrap();
|
||||
std::fs::write(
|
||||
sk.join("project.toml"),
|
||||
"[[agent]]\nname = \"coder-1\"\nstage = \"coder\"\n",
|
||||
)
|
||||
.unwrap();
|
||||
std::fs::write(
|
||||
backlog.join("356_story_test.md"),
|
||||
|
||||
// Seed the story in the content store + CRDT (no filesystem needed).
|
||||
crate::db::ensure_content_store();
|
||||
crate::db::write_item_with_content(
|
||||
"9976_story_test",
|
||||
"1_backlog",
|
||||
"---\nname: Test Story\n---\n",
|
||||
)
|
||||
.unwrap();
|
||||
);
|
||||
|
||||
let agents = Arc::new(AgentPool::new_test(3000));
|
||||
agents.inject_test_agent("other-story", "coder-1", AgentStatus::Running);
|
||||
|
||||
let response = handle_start("Timmy", "356", None, project_root, &agents).await;
|
||||
let response = handle_start("Timmy", "9976", None, project_root, &agents).await;
|
||||
|
||||
assert!(
|
||||
!response.contains("Failed"),
|
||||
|
||||
Reference in New Issue
Block a user