diff --git a/server/src/http/mcp/status_tools.rs b/server/src/http/mcp/status_tools.rs index f370b9e9..be7cf19e 100644 --- a/server/src/http/mcp/status_tools.rs +++ b/server/src/http/mcp/status_tools.rs @@ -202,6 +202,29 @@ pub(super) async fn tool_status(args: &Value, ctx: &AppContext) -> Result 0.0 + { + front_matter.insert("claimed_at".to_string(), json!(ca)); + } } // --- AC checklist --- @@ -336,6 +359,29 @@ mod tests { assert!(result.unwrap_err().contains("not found in work/2_current/")); } + #[tokio::test] + async fn tool_status_returns_blocked_retry_count_and_depends_on() { + let tmp = tempdir().unwrap(); + + 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); + + 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) + .await + .unwrap(); + let parsed: serde_json::Value = serde_json::from_str(&result).unwrap(); + + assert_eq!(parsed["front_matter"]["blocked"], true); + assert_eq!(parsed["front_matter"]["retry_count"], 3); + let depends_on = parsed["front_matter"]["depends_on"].as_array().unwrap(); + assert_eq!(depends_on.len(), 2); + assert_eq!(depends_on[0], 100); + assert_eq!(depends_on[1], 200); + } + #[tokio::test] async fn tool_status_returns_story_data() { let tmp = tempdir().unwrap();