huskies: merge 864

This commit is contained in:
dave
2026-04-30 22:23:21 +00:00
parent 3911c24c26
commit 61cf7684de
41 changed files with 540 additions and 71 deletions
+18 -3
View File
@@ -449,7 +449,12 @@ mod tests {
let content = "---\nname: Test\n---\n";
fs::write(backlog.join("5_story_test.md"), content).unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content("5_story_test", "1_backlog", content);
crate::db::write_item_with_content(
"5_story_test",
"1_backlog",
content,
crate::db::ItemMeta::from_yaml(content),
);
let ctx = test_ctx(root);
let result = super::super::tool_move_story(
@@ -476,7 +481,12 @@ mod tests {
let content = "---\nname: Back\n---\n";
fs::write(current.join("6_story_back.md"), content).unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content("6_story_back", "2_current", content);
crate::db::write_item_with_content(
"6_story_back",
"2_current",
content,
crate::db::ItemMeta::from_yaml(content),
);
let ctx = test_ctx(root);
let result = super::super::tool_move_story(
@@ -503,7 +513,12 @@ mod tests {
let content = "---\nname: Idem\n---\n";
fs::write(current.join("9907_story_idem.md"), content).unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content("9907_story_idem", "2_current", content);
crate::db::write_item_with_content(
"9907_story_idem",
"2_current",
content,
crate::db::ItemMeta::from_yaml(content),
);
let ctx = test_ctx(root);
let result = super::super::tool_move_story(
+12 -2
View File
@@ -366,7 +366,12 @@ mod tests {
crate::crdt_state::init_for_test();
crate::db::ensure_content_store();
let story_content = "---\nname: Blocked Story\nblocked: true\nretry_count: 3\ndepends_on: [100, 200]\n---\n\n## Acceptance Criteria\n\n- [ ] Do the thing\n";
crate::db::write_item_with_content("9887_story_blocked_test", "2_current", story_content);
crate::db::write_item_with_content(
"9887_story_blocked_test",
"2_current",
story_content,
crate::db::ItemMeta::from_yaml(story_content),
);
let ctx = crate::http::context::AppContext::new_test(tmp.path().to_path_buf());
let result = tool_status(&json!({"story_id": "9887_story_blocked_test"}), &ctx)
@@ -388,7 +393,12 @@ mod tests {
crate::db::ensure_content_store();
let story_content = "---\nname: My Test Story\nagent: coder-1\n---\n\n## Acceptance Criteria\n\n- [ ] First criterion\n- [x] Second criterion\n\n## Out of Scope\n\n- nothing\n";
crate::db::write_item_with_content("9886_story_status_test", "2_current", story_content);
crate::db::write_item_with_content(
"9886_story_status_test",
"2_current",
story_content,
crate::db::ItemMeta::from_yaml(story_content),
);
let ctx = crate::http::context::AppContext::new_test(tmp.path().to_path_buf());
let result = tool_status(&json!({"story_id": "9886_story_status_test"}), &ctx)
+12 -1
View File
@@ -290,11 +290,17 @@ mod tests {
"9902_bug_crash",
"1_backlog",
"---\nname: \"App Crash\"\n---\n# Bug 9902: App Crash\n",
crate::db::ItemMeta::from_yaml(
"---\nname: \"App Crash\"\n---\n# Bug 9902: App Crash\n",
),
);
crate::db::write_item_with_content(
"9903_bug_typo",
"1_backlog",
"---\nname: \"Typo in Header\"\n---\n# Bug 9903: Typo in Header\n",
crate::db::ItemMeta::from_yaml(
"---\nname: \"Typo in Header\"\n---\n# Bug 9903: Typo in Header\n",
),
);
let ctx = test_ctx(tmp.path());
@@ -438,7 +444,12 @@ mod tests {
let content = "# Bug 9901: Crash\n";
std::fs::write(&bug_file, content).unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content("9901_bug_crash", "1_backlog", content);
crate::db::write_item_with_content(
"9901_bug_crash",
"1_backlog",
content,
crate::db::ItemMeta::from_yaml(content),
);
// Stage the file so it's tracked
std::process::Command::new("git")
.args(["add", "."])
+22 -1
View File
@@ -421,6 +421,9 @@ mod tests {
"9901_test",
"2_current",
"---\nname: Test\n---\n## AC\n- [ ] First\n- [x] Done\n- [ ] Second\n",
crate::db::ItemMeta::from_yaml(
"---\nname: Test\n---\n## AC\n- [ ] First\n- [x] Done\n- [ ] Second\n",
),
);
let ctx = test_ctx(tmp.path());
@@ -514,6 +517,7 @@ mod tests {
"9906_story_persist",
"2_current",
"---\nname: Persist\n---\n# Story\n",
crate::db::ItemMeta::from_yaml("---\nname: Persist\n---\n# Story\n"),
);
let ctx = test_ctx(tmp.path());
@@ -547,7 +551,12 @@ mod tests {
// Write story content to CRDT with a pre-populated Test Results section
let story_content = "---\nname: Persist\n---\n# Story\n\n## Test Results\n\n<!-- huskies-test-results: {\"unit\":[{\"name\":\"u1\",\"status\":\"pass\",\"details\":null}],\"integration\":[{\"name\":\"i1\",\"status\":\"pass\",\"details\":null}]} -->\n";
crate::db::ensure_content_store();
crate::db::write_item_with_content("9905_story_file_only", "2_current", story_content);
crate::db::write_item_with_content(
"9905_story_file_only",
"2_current",
story_content,
crate::db::ItemMeta::from_yaml(story_content),
);
let ctx = test_ctx(tmp.path());
@@ -618,6 +627,9 @@ mod tests {
"9997_empty_branch",
"2_current",
"---\nname: Empty Branch Test\n---\n## AC\n- [ ] Implement the feature\n",
crate::db::ItemMeta::from_yaml(
"---\nname: Empty Branch Test\n---\n## AC\n- [ ] Implement the feature\n",
),
);
let ctx = test_ctx(tmp.path());
@@ -672,6 +684,9 @@ mod tests {
"9904_test",
"2_current",
"---\nname: Test\n---\n## AC\n- [ ] First criterion\n- [x] Already done\n",
crate::db::ItemMeta::from_yaml(
"---\nname: Test\n---\n## AC\n- [ ] First criterion\n- [x] Already done\n",
),
);
let ctx = test_ctx(tmp.path());
@@ -711,6 +726,9 @@ mod tests {
"9905_test",
"2_current",
"---\nname: Test\n---\n## Acceptance Criteria\n- [ ] Keep me\n- [ ] Remove me\n",
crate::db::ItemMeta::from_yaml(
"---\nname: Test\n---\n## Acceptance Criteria\n- [ ] Keep me\n- [ ] Remove me\n",
),
);
let ctx = test_ctx(tmp.path());
@@ -732,6 +750,9 @@ mod tests {
"9906_test",
"2_current",
"---\nname: Test\n---\n## Acceptance Criteria\n- [ ] Only one\n",
crate::db::ItemMeta::from_yaml(
"---\nname: Test\n---\n## Acceptance Criteria\n- [ ] Only one\n",
),
);
let ctx = test_ctx(tmp.path());
+9
View File
@@ -246,17 +246,26 @@ mod tests {
"9990_epic_rollup",
"1_backlog",
"---\ntype: epic\nname: \"Rollup Epic\"\n---\n\n## Goal\n\nTest\n",
crate::db::ItemMeta::from_yaml(
"---\ntype: epic\nname: \"Rollup Epic\"\n---\n\n## Goal\n\nTest\n",
),
);
// Write two member items: one done, one current.
crate::db::write_item_with_content(
"9991_story_member_done",
"5_done",
"---\ntype: story\nname: \"Done Member\"\nepic: \"9990_epic_rollup\"\n---\n",
crate::db::ItemMeta::from_yaml(
"---\ntype: story\nname: \"Done Member\"\nepic: \"9990_epic_rollup\"\n---\n",
),
);
crate::db::write_item_with_content(
"9992_story_member_current",
"2_current",
"---\ntype: story\nname: \"Current Member\"\nepic: \"9990_epic_rollup\"\n---\n",
crate::db::ItemMeta::from_yaml(
"---\ntype: story\nname: \"Current Member\"\nepic: \"9990_epic_rollup\"\n---\n",
),
);
let tmp = tempfile::tempdir().unwrap();
@@ -216,7 +216,12 @@ mod tests {
let content = "---\nname: No Branch\n---\n";
std::fs::write(current_dir.join("51_story_no_branch.md"), content).unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content("51_story_no_branch", "2_current", content);
crate::db::write_item_with_content(
"51_story_no_branch",
"2_current",
content,
crate::db::ItemMeta::from_yaml(content),
);
let ctx = test_ctx(tmp.path());
let result = tool_accept_story(&json!({"story_id": "51_story_no_branch"}), &ctx);
@@ -60,6 +60,7 @@ mod tests {
story_id,
"2_current",
"---\nname: MCP Freeze Tool Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: MCP Freeze Tool Test\n---\n"),
);
let tmp = tempfile::tempdir().unwrap();
@@ -88,6 +89,7 @@ mod tests {
story_id,
"2_current",
"---\nname: MCP Unfreeze Tool Test\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: MCP Unfreeze Tool Test\n---\n"),
);
let tmp = tempfile::tempdir().unwrap();
+14 -2
View File
@@ -150,7 +150,12 @@ mod tests {
("4_merge", "9940_story_merge", "Merge Story"),
("5_done", "9950_story_done", "Done Story"),
] {
crate::db::write_item_with_content(id, stage, &format!("---\nname: \"{name}\"\n---\n"));
crate::db::write_item_with_content(
id,
stage,
&format!("---\nname: \"{name}\"\n---\n"),
crate::db::ItemMeta::from_yaml(&format!("---\nname: \"{name}\"\n---\n")),
);
}
let ctx = test_ctx(tmp.path());
@@ -187,6 +192,7 @@ mod tests {
"9921_story_active",
"2_current",
"---\nname: \"Active Story\"\n---\n",
crate::db::ItemMeta::from_yaml("---\nname: \"Active Story\"\n---\n"),
);
let ctx = test_ctx(tmp.path());
@@ -219,6 +225,7 @@ mod tests {
"9907_test",
"2_current",
"---\nname: \"Valid Story\"\n---\n## AC\n- [ ] First\n",
crate::db::ItemMeta::from_yaml("---\nname: \"Valid Story\"\n---\n## AC\n- [ ] First\n"),
);
let ctx = test_ctx(tmp.path());
@@ -236,7 +243,12 @@ mod tests {
let tmp = tempfile::tempdir().unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content("9908_test", "2_current", "## No front matter at all\n");
crate::db::write_item_with_content(
"9908_test",
"2_current",
"## No front matter at all\n",
crate::db::ItemMeta::from_yaml("## No front matter at all\n"),
);
let ctx = test_ctx(tmp.path());
let result = tool_validate_stories(&ctx).unwrap();
@@ -150,7 +150,12 @@ mod tests {
fs::create_dir_all(&current).unwrap();
fs::write(current.join(format!("{story_id}.md")), content).unwrap();
crate::db::ensure_content_store();
crate::db::write_item_with_content(story_id, "2_current", content);
crate::db::write_item_with_content(
story_id,
"2_current",
content,
crate::db::ItemMeta::from_yaml(content),
);
}
#[test]