huskies: merge 946

This commit is contained in:
dave
2026-05-13 07:54:50 +00:00
parent 4a0fbcaa95
commit a7840ea4b0
49 changed files with 378 additions and 314 deletions
+5 -5
View File
@@ -63,7 +63,7 @@ pub(super) fn handle_depends(ctx: &CommandContext) -> Option<String> {
// Story name comes from the CRDT register, not the on-disk YAML
// (story 929 — CRDT is the sole source of story metadata).
let story_name = crate::crdt_state::read_item(&story_id)
.and_then(|w| w.name().map(str::to_string))
.map(|w| w.name().to_string())
.unwrap_or_else(|| story_id.clone());
// Write depends_on to the typed CRDT register — single source of truth.
@@ -183,7 +183,7 @@ mod tests {
"1_backlog",
"9910_story_foo.md",
"---\nname: Foo\n---\n",
None,
Some("Foo"),
);
let output = depends_cmd_with_root(tmp.path(), "9910 477 478").unwrap();
assert!(
@@ -214,7 +214,7 @@ mod tests {
"2_current",
"9911_story_bar.md",
"---\nname: Bar\n---\n",
None,
Some("Bar"),
);
// Pre-seed CRDT with deps so we can verify clearing.
crate::crdt_state::set_depends_on("9911_story_bar", &[477]);
@@ -251,7 +251,7 @@ mod tests {
"1_backlog",
"8790_story_chat_dep.md",
"---\nname: Chat Dep\n---\n",
None,
Some("Chat Dep"),
);
let out = depends_cmd_with_root(tmp.path(), "8790 500 501").unwrap();
@@ -286,7 +286,7 @@ mod tests {
"1_backlog",
"9920_story_scr.md",
"---\nname: SCR\n---\n",
None,
Some("SCR"),
);
// Set to [1, 2, 3].
+1 -1
View File
@@ -212,7 +212,7 @@ mod tests {
"2_current",
"55551_story_no_worktree.md",
"---\nname: No Worktree\n---\n",
None,
Some("No Worktree"),
);
let output = diff_cmd(tmp.path(), "55551").unwrap();
assert!(
+2 -2
View File
@@ -98,7 +98,7 @@ fn unfreeze_by_story_id(story_id: &str) -> String {
/// Falls back to `story_id` if no CRDT entry exists.
fn resolve_story_name(story_id: &str) -> String {
crate::crdt_state::read_item(story_id)
.and_then(|w| w.name().map(str::to_string))
.map(|w| w.name().to_string())
.unwrap_or_else(|| story_id.to_string())
}
@@ -274,7 +274,7 @@ mod tests {
"2_current",
"9943_story_alreadyfrozen.md",
"---\nname: Already Frozen\n---\n# Story\n",
None,
Some("Already Frozen"),
);
// Freeze it first.
freeze_cmd_with_root(tmp.path(), "9943").unwrap();
+2 -2
View File
@@ -202,7 +202,7 @@ mod tests {
"2_current",
"77_story_no_log.md",
"---\nname: No Log\n---\n",
None,
Some("No Log"),
);
let output = logs_cmd(tmp.path(), "77").unwrap();
assert!(
@@ -222,7 +222,7 @@ mod tests {
"2_current",
"88_story_has_log.md",
"---\nname: Has Log\n---\n",
None,
Some("Has Log"),
);
// Write a log file in the expected location.
let log_dir = tmp
+1 -2
View File
@@ -57,8 +57,7 @@ pub(super) fn handle_move(ctx: &CommandContext) -> Option<String> {
};
// Display name comes from the CRDT name register (story 929).
let found_name =
crate::crdt_state::read_item(&story_id).and_then(|w| w.name().map(str::to_string));
let found_name = crate::crdt_state::read_item(&story_id).map(|w| w.name().to_string());
let display_name = found_name.as_deref().unwrap_or(&story_id);
+1 -1
View File
@@ -110,7 +110,7 @@ fn find_story_merge_commit(root: &std::path::Path, num_str: &str) -> Option<Stri
/// (story 929 — CRDT is the sole source of story metadata).
fn find_story_name(root: &std::path::Path, num_str: &str) -> Option<String> {
let (story_id, _, _, _) = crate::chat::lookup::find_story_by_number(root, num_str)?;
crate::crdt_state::read_item(&story_id).and_then(|w| w.name().map(str::to_string))
crate::crdt_state::read_item(&story_id).map(|w| w.name().to_string())
}
/// Return the `git show --stat` output for a commit.
+4 -7
View File
@@ -72,10 +72,7 @@ fn build_triage_dump(
// Story metadata now comes from the CRDT registers and adjacent CRDT entries
// (MergeJob.error), not from YAML front matter (story 929).
let crdt_item = crate::crdt_state::read_item(story_id);
let name = crdt_item
.as_ref()
.and_then(|w| w.name())
.unwrap_or("(unnamed)");
let name = crdt_item.as_ref().map(|w| w.name()).unwrap_or("(unnamed)");
let mut out = String::new();
@@ -377,7 +374,7 @@ mod tests {
"2_current",
"99_story_criteria_test.md",
"---\nname: Criteria Test\n---\n\n- [ ] First thing\n- [x] Done thing\n- [ ] Second thing\n",
None,
Some("Criteria Test"),
);
let output = status_triage_cmd(tmp.path(), "99").unwrap();
assert!(
@@ -403,7 +400,7 @@ mod tests {
"2_current",
"55_story_blocked_story.md",
"---\nname: Blocked Story\nblocked: true\n---\n",
None,
Some("Blocked Story"),
);
let output = status_triage_cmd(tmp.path(), "55").unwrap();
assert!(
@@ -460,7 +457,7 @@ mod tests {
"2_current",
"77_story_no_worktree.md",
"---\nname: No Worktree\n---\n",
None,
Some("No Worktree"),
);
let output = status_triage_cmd(tmp.path(), "77").unwrap();
// Branch name should still appear
+1 -1
View File
@@ -55,7 +55,7 @@ fn unblock_by_story_id(story_id: &str) -> String {
let crdt_item = crate::crdt_state::read_item(story_id);
let story_name = crdt_item
.as_ref()
.and_then(|i| i.name().map(str::to_string))
.map(|i| i.name().to_string())
.unwrap_or_else(|| story_id.to_string());
// Story 945: `Stage::Blocked` / `Stage::MergeFailure` are the single
+1 -1
View File
@@ -146,7 +146,7 @@ fn find_story_name(_root: &std::path::Path, num_str: &str) -> Option<String> {
let items = crate::crdt_state::read_all_items()?;
for item in items {
if item.story_id().split('_').next().unwrap_or("") == num_str {
return item.name().map(str::to_string);
return Some(item.name().to_string());
}
}
None