huskies: merge 492_story_remove_filesystem_pipeline_state_and_store_story_content_in_database

This commit is contained in:
dave
2026-04-08 03:03:59 +00:00
parent f43d30bdae
commit 8fd49d563e
27 changed files with 1663 additions and 1295 deletions
+13 -7
View File
@@ -148,15 +148,21 @@ fn slug_to_name(slug: &str) -> String {
words.join(" ")
}
/// Find the human-readable name of a story by searching all pipeline stages.
/// Find the human-readable name of a story by searching content store then filesystem.
fn find_story_name(root: &std::path::Path, num_str: &str) -> Option<String> {
// Try content store first.
for id in crate::db::all_content_ids() {
let file_num = id.split('_').next().unwrap_or("");
if file_num == num_str && let Some(c) = crate::db::read_content(&id) {
return crate::io::story_metadata::parse_front_matter(&c)
.ok()
.and_then(|m| m.name);
}
}
// Fallback: filesystem scan.
const STAGES: &[&str] = &[
"1_backlog",
"2_current",
"3_qa",
"4_merge",
"5_done",
"6_archived",
"1_backlog", "2_current", "3_qa", "4_merge", "5_done", "6_archived",
];
for stage in STAGES {
let dir = root.join(".huskies").join("work").join(stage);