fix: add --all to cargo fmt in script/test and autoformat codebase

cargo fmt without --all fails with "Failed to find targets" in
workspace repos. This was blocking every story's gates. Also ran
cargo fmt --all to fix all existing formatting issues.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
dave
2026-04-13 14:07:08 +00:00
parent ed2526ce41
commit 845b85e7a7
128 changed files with 3566 additions and 2395 deletions
+14 -7
View File
@@ -153,7 +153,8 @@ pub(super) async fn tool_prompt_permission(
// Try to forward to the interactive session (WebSocket/Matrix).
// If no session is active (headless agent), auto-deny the permission.
if ctx.perm_tx
if ctx
.perm_tx
.send(crate::http::context::PermissionForward {
request_id: request_id.clone(),
tool_name: tool_name.clone(),
@@ -321,8 +322,8 @@ pub(super) fn tool_dump_crdt(args: &Value) -> Result<String, String> {
/// MCP tool: return the server version and build hash.
pub(super) fn tool_get_version() -> Result<String, String> {
let build_hash = std::fs::read_to_string(".huskies/build_hash")
.unwrap_or_else(|_| "unknown".to_string());
let build_hash =
std::fs::read_to_string(".huskies/build_hash").unwrap_or_else(|_| "unknown".to_string());
serde_json::to_string_pretty(&json!({
"version": env!("CARGO_PKG_VERSION"),
"build_hash": build_hash.trim(),
@@ -338,7 +339,10 @@ pub(super) fn tool_loc_file(args: &Value, ctx: &AppContext) -> Result<String, St
.ok_or_else(|| "Missing required argument: file_path".to_string())?;
let project_root = ctx.state.get_project_root()?;
Ok(crate::chat::commands::loc::loc_single_file(&project_root, file_path))
Ok(crate::chat::commands::loc::loc_single_file(
&project_root,
file_path,
))
}
#[cfg(test)]
@@ -851,8 +855,7 @@ mod tests {
#[test]
fn tool_dump_crdt_with_story_id_filter_returns_valid_json() {
let result =
tool_dump_crdt(&json!({"story_id": "9999_story_nonexistent"})).unwrap();
let result = tool_dump_crdt(&json!({"story_id": "9999_story_nonexistent"})).unwrap();
let parsed: Value = serde_json::from_str(&result).unwrap();
assert!(parsed["items"].as_array().unwrap().is_empty());
}
@@ -866,7 +869,11 @@ mod tests {
assert!(tool.is_some(), "dump_crdt missing from tools list");
let t = tool.unwrap();
assert!(
t["description"].as_str().unwrap().to_lowercase().contains("debug"),
t["description"]
.as_str()
.unwrap()
.to_lowercase()
.contains("debug"),
"description must mention this is a debug tool"
);
assert!(t["inputSchema"].is_object());