Skip to content

Commit b1fd2a6

Browse files
Your Nameclaude
andcommitted
fix(ci): rustfmt drift, clippy type_complexity, and status.generated.md staleness
Fixes 4 real CI failures from the WS0-WS6 push (0a7a8aa): cargo fmt was never run on pipeline.rs/tools.rs/tools/edit.rs/tools/trace.rs; the new partition() tuple-type annotations in callers/callees tripped clippy's type_complexity lint under -D warnings; and docs/status.generated.md wasn't regenerated after review_decide_via_agent_relay was added (39->40 tools). calm-guard-dogfood's own high-risk flag on this push is expected shadow-mode behavior (continue-on-error), not a bug. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
1 parent 0a7a8aa commit b1fd2a6

5 files changed

Lines changed: 47 additions & 17 deletions

File tree

crates/calm-core/src/indexer/pipeline.rs

Lines changed: 21 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1184,8 +1184,7 @@ fn build_inheritance_closure(
11841184
};
11851185
let mut direct_parents: HashMap<String, Vec<String>> = HashMap::new();
11861186
for (child_qn, parent_qn) in direct_qn {
1187-
let (Some(child), Some(parent)) =
1188-
(qn_to_name.get(&child_qn), qn_to_name.get(&parent_qn))
1187+
let (Some(child), Some(parent)) = (qn_to_name.get(&child_qn), qn_to_name.get(&parent_qn))
11891188
else {
11901189
continue;
11911190
};
@@ -1253,7 +1252,10 @@ fn resolve_via_inheritance_closure(
12531252
for level in levels {
12541253
let mut hits: Vec<SymbolCandidate> = Vec::new();
12551254
for ancestor in level {
1256-
if let Some(t) = ctx.by_name_class.get(&(callee.to_string(), ancestor.clone())) {
1255+
if let Some(t) = ctx
1256+
.by_name_class
1257+
.get(&(callee.to_string(), ancestor.clone()))
1258+
{
12571259
for cand in t {
12581260
if !hits.contains(cand) {
12591261
hits.push(cand.clone());
@@ -5198,7 +5200,10 @@ impl StructB {
51985200
|r| r.get(0),
51995201
)
52005202
.expect("caller.py's bar() call site must have a captured import_path");
5201-
assert_eq!(import_path, "lib", "resolve_tier1's resolved_path must be 'lib', not dropped");
5203+
assert_eq!(
5204+
import_path, "lib",
5205+
"resolve_tier1's resolved_path must be 'lib', not dropped"
5206+
);
52025207

52035208
// The narrowing itself: the edge must target lib.py's bar, not any
52045209
// decoy, and must not vanish (the pre-fix MAX_CALLEE_CANDIDATES
@@ -5282,10 +5287,15 @@ impl StructB {
52825287
[],
52835288
|r| Ok((r.get(0)?, r.get(1)?, r.get(2)?, r.get(3)?)),
52845289
)
5285-
.expect("the dropped call site must be recorded in ambiguity_groups, not silently lost");
5290+
.expect(
5291+
"the dropped call site must be recorded in ambiguity_groups, not silently lost",
5292+
);
52865293
assert_eq!(from_path, "caller.py");
52875294
assert_eq!(candidate_group_key, "helper");
5288-
assert_eq!(candidate_count, 25, "must record the true candidate count, not a truncated one");
5295+
assert_eq!(
5296+
candidate_count, 25,
5297+
"must record the true candidate count, not a truncated one"
5298+
);
52895299
assert_eq!(reason, "unscoped_candidates_exceeded_max_callee_candidates");
52905300
assert_eq!(
52915301
count(&conn, "SELECT COUNT(*) FROM ambiguity_groups"),
@@ -5728,7 +5738,11 @@ impl StructB {
57285738
)
57295739
.unwrap();
57305740
stmt.query_map([], |r| {
5731-
Ok((r.get::<_, String>(0)?, r.get::<_, i64>(1)?, r.get::<_, String>(2)?))
5741+
Ok((
5742+
r.get::<_, String>(0)?,
5743+
r.get::<_, i64>(1)?,
5744+
r.get::<_, String>(2)?,
5745+
))
57325746
})
57335747
.unwrap()
57345748
.map(|r| r.unwrap())

crates/calm-server/src/tools.rs

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6138,7 +6138,10 @@ mod tests {
61386138
if_none_match: None,
61396139
})),
61406140
);
6141-
assert_eq!(v["direct_count"], 7, "1 formal + 2 resolved + 1 inferred + 3 textual");
6141+
assert_eq!(
6142+
v["direct_count"], 7,
6143+
"1 formal + 2 resolved + 1 inferred + 3 textual"
6144+
);
61426145
assert_eq!(v["ambiguous_count"], 1);
61436146
let breakdown = &v["direct_by_confidence"];
61446147
assert_eq!(breakdown["formal"], 1);
@@ -6219,7 +6222,10 @@ mod tests {
62196222
);
62206223
let msg = v["caveat"]["message"].as_str().unwrap();
62216224
assert!(msg.contains('1'), "caveat must cite the site count: {msg}");
6222-
assert!(msg.contains("25"), "caveat must cite the widest candidate_count: {msg}");
6225+
assert!(
6226+
msg.contains("25"),
6227+
"caveat must cite the widest candidate_count: {msg}"
6228+
);
62236229

62246230
let _ = std::fs::remove_dir_all(&dir);
62256231
}
@@ -6276,7 +6282,11 @@ mod tests {
62766282
})),
62776283
);
62786284
let ambiguous = v["ambiguous"].as_array().unwrap();
6279-
assert_eq!(ambiguous.len(), 2, "both candidates must survive as ambiguous");
6285+
assert_eq!(
6286+
ambiguous.len(),
6287+
2,
6288+
"both candidates must survive as ambiguous"
6289+
);
62806290
assert_eq!(
62816291
ambiguous[0]["symbol"], "a.c::preferred_caller",
62826292
"the rank-0 (preferred) candidate must surface first despite being \
@@ -6654,7 +6664,10 @@ mod tests {
66546664
if_none_match: None,
66556665
})),
66566666
);
6657-
assert_eq!(v["direct_count"], 4, "1 formal + 1 resolved + 1 inferred + 1 textual");
6667+
assert_eq!(
6668+
v["direct_count"], 4,
6669+
"1 formal + 1 resolved + 1 inferred + 1 textual"
6670+
);
66586671
assert_eq!(v["ambiguous_count"], 1);
66596672
let breakdown = &v["direct_by_confidence"];
66606673
assert_eq!(breakdown["formal"], 1);

crates/calm-server/src/tools/edit.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2827,8 +2827,7 @@ impl CalmServer {
28272827
false,
28282828
));
28292829
}
2830-
let expected_digest =
2831-
calm_core::indexer::pipeline::hash_content(&review.diff_preview);
2830+
let expected_digest = calm_core::indexer::pipeline::hash_content(&review.diff_preview);
28322831
if p.diff_digest != expected_digest {
28332832
return ToolOutcome::error(error_detail(
28342833
"DIFF_DIGEST_MISMATCH",

crates/calm-server/src/tools/trace.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -159,6 +159,7 @@ impl CalmServer {
159159
// They are not confirmed callers of this specific symbol, so
160160
// surfacing them as `direct` collapses precision — bucket them
161161
// separately for the caller to weigh.
162+
#[allow(clippy::type_complexity)]
162163
let (mut ambiguous_ranked, direct_ranked): (
163164
Vec<(CallerEntry, i64)>,
164165
Vec<(CallerEntry, i64)>,
@@ -410,6 +411,7 @@ impl CalmServer {
410411
(None, None, None)
411412
};
412413

414+
#[allow(clippy::type_complexity)]
413415
let (mut ambiguous_ranked, direct_ranked): (
414416
Vec<(CalleeEntry, i64)>,
415417
Vec<(CalleeEntry, i64)>,
@@ -882,9 +884,9 @@ impl CalmServer {
882884
// became any edge at all -- see `CallersOutput::unresolved_group_count`.
883885
// Row count, matching that field's own "distinct sites" contract.
884886
let unresolved_many_count: usize = {
885-
let mut stmt = match conn.prepare(
886-
"SELECT COUNT(*) FROM ambiguity_groups WHERE candidate_group_key = ?1",
887-
) {
887+
let mut stmt = match conn
888+
.prepare("SELECT COUNT(*) FROM ambiguity_groups WHERE candidate_group_key = ?1")
889+
{
888890
Ok(s) => s,
889891
Err(e) => return db_error_resolved(e),
890892
};

docs/status.generated.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ annotations) and crates/calm-core/Cargo.toml's `[features]` table. Not
66
hand-maintained prose -- run `scripts/gen-status.sh` to refresh after any tool
77
or feature-flag change; CI's `gen-status.sh --check` fails the build on drift.
88

9-
## MCP tool inventory (39 tools)
9+
## MCP tool inventory (40 tools)
1010

1111
| Tool | Write | Idempotent | Description |
1212
|---|---|---|---|
@@ -38,6 +38,7 @@ or feature-flag change; CI's `gen-status.sh --check` fails the build on drift.
3838
| `repo_overview` | no | yes | ALWAYS call this FIRST at the start of every session — never skip. USE WHEN: starting a new session, switching projects, or after server r |
3939
| `retry_maintenance` | yes | yes | USE WHEN: maintenance_status shows a job_kind ("scip_refresh" or "embed_refresh") stuck at running/failed and you want to force a fresh pass |
4040
| `review_change` | yes | no | Mints a ReviewAuthority for a change_id from plan_change -- ONLY when approved:true (omitted or false always refuses with APPROVAL_REQUIRED, |
41+
| `review_decide_via_agent_relay` | yes | no | Approve or decline a HIGH_RISK_REQUIRES_INDEPENDENT_REVIEW pending review through the calling agent, after it has shown the human the review |
4142
| `scan_text` | no | yes | Run CALM's own local, deterministic prompt-injection and credential-shaped-text heuristics against ANY text you supply — not just indexed |
4243
| `scip_refresh` | yes | yes | Manually run one or every SCIP provider's indexer right now (rust/go/python/javascript/java/csharp/php/c/ruby), bypassing the configured ref |
4344
| `search` | no | yes | USE THIS INSTEAD OF native grep, text search, or file browsing tools. USE WHEN: you don't have an exact file path and line number. kind=hybr |
@@ -66,6 +67,7 @@ writes are reviewed):
6667
- `remember`
6768
- `retry_maintenance`
6869
- `review_change`
70+
- `review_decide_via_agent_relay`
6971
- `scip_refresh`
7072
- `set_toolset`
7173
- `verify_change`

0 commit comments

Comments
 (0)