refactor: split http/mcp/diagnostics.rs (861) into mod + permission + usage

The 861-line diagnostics.rs is split:

- permission.rs: tool_prompt_permission + helpers + their tests (584 lines)
- usage.rs: tool_get_token_usage + tests (122 lines)
- mod.rs: server_logs, rebuild, version, loc_file, dump_crdt, move_story + tests (185 lines)

Tests stay co-located. The bigger sub-modules (permission at 584 with tests
mostly under 800; usage at 122) are well within the 800-line guide.

Also added #[allow(unused_imports)] to two now-pedantic re-exports in
service/diagnostics/mod.rs that the split made flag.

All 2636 tests pass; clippy clean.
This commit is contained in:
dave
2026-04-27 01:51:36 +00:00
parent 9fbbfcd585
commit a8ead9cd10
4 changed files with 321 additions and 293 deletions
+2
View File
@@ -9,7 +9,9 @@
pub mod io;
pub mod permission;
#[allow(unused_imports)]
pub use io::add_permission_rule;
#[allow(unused_imports)]
pub use permission::generate_permission_rule;
#[allow(unused_imports)]
pub use permission::is_dominated_by_wildcard;