refactor: split http/mcp/story_tools.rs into 5 sub-modules by item type

The 1864-line story_tools.rs is split into:

- story.rs: story creation/lifecycle/management (903 lines incl. tests)
- criteria.rs: acceptance-criteria tools (534 lines)
- bug.rs: bug item tools (318 lines)
- spike.rs: spike item tools (120 lines)
- refactor.rs: refactor item tools (60 lines)
- mod.rs: re-exports (25 lines)

Tests stay co-located with the code they exercise; setup_git_repo_in and
setup_story_for_update test helpers are duplicated into the modules that need
them rather than centralised, since they are tiny and test-only.

No behaviour change. All 60 story_tools tests pass; full suite green
(2635 tests with --test-threads=1).
This commit is contained in:
dave
2026-04-26 21:11:09 +00:00
parent 0dff2d5c47
commit 851324740c
7 changed files with 2040 additions and 1864 deletions
+25
View File
@@ -0,0 +1,25 @@
//! MCP story tools — create, update, move, and manage stories, bugs, refactors,
//! and spikes via MCP.
//!
//! This module is a thin adapter: it deserialises MCP payloads, delegates to
//! `crate::service::story` and `crate::http::workflow` for business logic,
//! and serialises responses.
mod bug;
mod criteria;
mod refactor;
mod spike;
mod story;
pub(crate) use bug::{tool_close_bug, tool_create_bug, tool_list_bugs};
pub(crate) use criteria::{
tool_add_criterion, tool_check_criterion, tool_edit_criterion, tool_ensure_acceptance,
tool_get_story_todos, tool_record_tests, tool_remove_criterion,
};
pub(crate) use refactor::{tool_create_refactor, tool_list_refactors};
pub(crate) use spike::tool_create_spike;
pub(crate) use story::{
tool_accept_story, tool_create_story, tool_delete_story, tool_get_pipeline_status,
tool_list_upcoming, tool_purge_story, tool_unblock_story, tool_update_story,
tool_validate_stories,
};