story-kit: merge 232_story_fix_incorrect_bug_tool_descriptions_in_mcp_tools_list

This commit is contained in:
Dave
2026-02-27 10:55:16 +00:00
parent 0ab18574d3
commit 38a2de472b

View File

@@ -678,7 +678,7 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
},
{
"name": "create_bug",
"description": "Create a bug file in .story_kit/bugs/ with a deterministic filename and auto-commit to master. Returns the bug_id.",
"description": "Create a bug file in work/1_upcoming/ with a deterministic filename and auto-commit to master. Returns the bug_id.",
"inputSchema": {
"type": "object",
"properties": {
@@ -713,7 +713,7 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
},
{
"name": "list_bugs",
"description": "List all open bugs (files in .story_kit/bugs/ excluding archive/).",
"description": "List all open bugs in work/1_upcoming/ matching the _bug_ naming convention.",
"inputSchema": {
"type": "object",
"properties": {}
@@ -721,7 +721,7 @@ fn handle_tools_list(id: Option<Value>) -> JsonRpcResponse {
},
{
"name": "close_bug",
"description": "Move a bug from .story_kit/bugs/ (or current/) to .story_kit/bugs/archive/ and auto-commit to master.",
"description": "Archive a bug from work/2_current/ or work/1_upcoming/ to work/5_done/ and auto-commit to master.",
"inputSchema": {
"type": "object",
"properties": {
@@ -2428,7 +2428,15 @@ mod tests {
let tool = tools.iter().find(|t| t["name"] == "create_bug");
assert!(tool.is_some(), "create_bug missing from tools list");
let t = tool.unwrap();
assert!(t["description"].is_string());
let desc = t["description"].as_str().unwrap();
assert!(
desc.contains("work/1_upcoming/"),
"create_bug description should reference work/1_upcoming/, got: {desc}"
);
assert!(
!desc.contains(".story_kit/bugs"),
"create_bug description should not reference nonexistent .story_kit/bugs/, got: {desc}"
);
let required = t["inputSchema"]["required"].as_array().unwrap();
let req_names: Vec<&str> = required.iter().map(|v| v.as_str().unwrap()).collect();
assert!(req_names.contains(&"name"));
@@ -2444,6 +2452,16 @@ mod tests {
let tools = resp.result.unwrap()["tools"].as_array().unwrap().clone();
let tool = tools.iter().find(|t| t["name"] == "list_bugs");
assert!(tool.is_some(), "list_bugs missing from tools list");
let t = tool.unwrap();
let desc = t["description"].as_str().unwrap();
assert!(
desc.contains("work/1_upcoming/"),
"list_bugs description should reference work/1_upcoming/, got: {desc}"
);
assert!(
!desc.contains(".story_kit/bugs"),
"list_bugs description should not reference nonexistent .story_kit/bugs/, got: {desc}"
);
}
#[test]
@@ -2453,6 +2471,15 @@ mod tests {
let tool = tools.iter().find(|t| t["name"] == "close_bug");
assert!(tool.is_some(), "close_bug missing from tools list");
let t = tool.unwrap();
let desc = t["description"].as_str().unwrap();
assert!(
!desc.contains(".story_kit/bugs"),
"close_bug description should not reference nonexistent .story_kit/bugs/, got: {desc}"
);
assert!(
desc.contains("work/5_done/"),
"close_bug description should reference work/5_done/, got: {desc}"
);
let required = t["inputSchema"]["required"].as_array().unwrap();
let req_names: Vec<&str> = required.iter().map(|v| v.as_str().unwrap()).collect();
assert!(req_names.contains(&"bug_id"));