fix(simulation): Clippy cleanup and CI enforcement (#635)

Fix all Clippy warnings across the server codebase (2411 insertions, 1341
deletions). Raise type-complexity-threshold to 750 and too-many-arguments
to 12 in .clippy.toml for idiomatic Bevy ECS system signatures. The server
now passes `cargo clippy -- --deny warnings` cleanly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-17 10:33:15 +01:00
co-authored by Claude Opus 4.6
parent 7f7706442a
commit aa79dd97e7
84 changed files with 2409 additions and 1339 deletions
+35 -9
View File
@@ -622,7 +622,12 @@ mod tests {
);
// Public is symmetric — even self-observation passes
assert!(filter_by_access(observer, observer, &ObserverAccess::Public, &kg));
assert!(filter_by_access(
observer,
observer,
&ObserverAccess::Public,
&kg
));
}
#[test]
@@ -630,7 +635,7 @@ mod tests {
// THE critical negative test (Sprint 12 joint briefing).
// A non-owner observer must NOT get access to OwnerOnly data.
let observer = StableId(1); // some other entity
let target = StableId(2); // owns the component
let target = StableId(2); // owns the component
let kg = KnowledgeGraph::new();
assert!(
@@ -657,8 +662,14 @@ mod tests {
let kg = KnowledgeGraph::new();
for id in 1u64..=10 {
assert!(
!filter_by_access(StableId(id), StableId(id + 1), &ObserverAccess::OwnerOnly, &kg),
"StableId({id}) should not match StableId({})", id + 1
!filter_by_access(
StableId(id),
StableId(id + 1),
&ObserverAccess::OwnerOnly,
&kg
),
"StableId({id}) should not match StableId({})",
id + 1
);
}
}
@@ -886,7 +897,10 @@ mod tests {
// Observe at SAME position — no contradiction
let result = g.observe_entity(target, make_position(10, 10), 200);
assert!(result.is_none(), "Same position should not be a contradiction");
assert!(
result.is_none(),
"Same position should not be a contradiction"
);
let entry = g.entity_knowledge(&target).unwrap();
assert_eq!(entry.state, KnowledgeState::Active);
assert!(entry.contradicted_claim.is_none());
@@ -1067,7 +1081,10 @@ mod tests {
.expect("contradiction should be detected");
let entry = g.entity_knowledge(&target).unwrap();
let stored = entry.contradicted_claim.as_ref().expect("field should be populated");
let stored = entry
.contradicted_claim
.as_ref()
.expect("field should be populated");
assert_eq!(stored.told_by, returned.told_by);
assert_eq!(stored.told_tick, returned.told_tick);
@@ -1114,7 +1131,10 @@ mod tests {
// Second observation (now source is DirectObservation, different position):
// state must stay Contradicted — contradiction is still unresolved.
let claim2 = g.observe_entity(target, make_position(11, 3), 300);
assert!(claim2.is_none(), "no new contradiction: DirectObservation source");
assert!(
claim2.is_none(),
"no new contradiction: DirectObservation source"
);
assert_eq!(
g.entity_knowledge(&target).unwrap().state,
KnowledgeState::Contradicted,
@@ -1158,8 +1178,14 @@ mod tests {
let a_result = g.observe_entity(entity_a, make_position(8, 1), 200);
let b_result = g.observe_entity(entity_b, make_position(9, 5), 200);
assert!(a_result.is_some(), "Entity A (ToldBy source) should contradict");
assert!(b_result.is_none(), "Entity B (DirectObservation) should not contradict");
assert!(
a_result.is_some(),
"Entity A (ToldBy source) should contradict"
);
assert!(
b_result.is_none(),
"Entity B (DirectObservation) should not contradict"
);
assert_eq!(
g.entity_knowledge(&entity_a).unwrap().state,
KnowledgeState::Contradicted