Skip to content

Commit 41c6f00

Browse files
chore(audit): clear lib+test warnings, fix prober dispatch bug, sync GraphQL ProverKind (#41)
Cargo `--lib --tests` and `cargo clippy --lib --tests` now run clean (0 warnings, 0 errors). 1460 unit + integration tests pass. Real bugs found and fixed: * `provers::mod::from_str`: `"prob"` alias was double-claimed. Line 525 routes it to `ProverKind::ProB` (B-method model checker); a later arm also tried to claim it for `ProverKind::ProbabilisticTypeChecker` (unreachable). Removed the dead alias — `prob-types` and `probabilistic` still reach the type-checker. * `gnn::fallback_monitor::record_fallback`: comment claimed "exponential moving average" with an unused `ema_weight = 0.2` local, but the formula is a cumulative arithmetic mean (and tests assert cumulative-mean values). Updated the comment to reflect actual behaviour and dropped the dead variable; SLA semantics unchanged. * `dispatch::cross_check_dispatch`: the cross-checker filter held the `health_status` `MutexGuard` across an `await` (clippy `await_holding_lock`). Restructured into an explicit scope so the guard is released before any await. * GraphQL workspace member did not compile: `cargo check -p echidna-graphql` reported 28 missing `ProverKind` variants. Synced `schema.rs` enum + `core_to_gql` + `gql_to_core`, `resolvers.rs` `ProverKindExt::{from_core,to_core}`, and `ffi_wrapper.rs` ordinals 113-140 with the core enum. (Mizar/MizAR are intentionally distinct.) Compliance fix: * `deno.json` license was `MIT OR AGPL-3.0-or-later` — project policy per CLAUDE.md is `PMPL-1.0-or-later` (explicitly "not AGPL"). Diagnostics fields preserved as ML acronyms: * `ModelHealth.{last_validation_nDCG, last_validation_MRR, nDCG_meets_threshold}` and `GnnTrainingMetrics.{nDCG, MRR}` now carry an `#[allow(non_snake_case)]` with a comment explaining that these field names match the JSON keys emitted by the Julia training pipeline (`src/julia/train_and_evaluate.jl`). Renaming would have silently broken the cross-language contract. Resilience accessors: * Exposed `CircuitBreaker::name(&self) -> &str` and `Bulkhead::config(&self) -> &BulkheadConfig` so the previously dead-but-stored fields are usable for diagnostics output. Remaining clippy items (mechanical): unused imports, doc list indentation, a few `field_reassign_with_default` cases (kept as-is with `#[allow(...)]` where the alternative is uglier), and type aliases for two complex closure-box types. Out of scope (left untouched): pre-existing `cargo fmt` drift across ~820 files, `cargo test --workspace` requires `protoc` (gRPC build), docs/* license-string drift in historical release notes, ROADMAP- acknowledged ReScript→AffineScript migration. https://claude.ai/code/session_01F6HnUof5QEwmf9nzbM8nc8 Co-authored-by: Claude <noreply@anthropic.com>
1 parent a652da4 commit 41c6f00

42 files changed

Lines changed: 320 additions & 106 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

deno.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"name": "@echidna/provers",
44
"version": "0.1.0",
55
"description": "ECHIDNA - Neurosymbolic Theorem Proving Platform",
6-
"license": "MIT OR AGPL-3.0-or-later",
6+
"license": "PMPL-1.0-or-later",
77

88
"compilerOptions": {
99
"allowJs": false,

src/interfaces/graphql/ffi_wrapper.rs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,34 @@ pub fn prover_kind_to_ffi(kind: &crate::schema::ProverKind) -> u8 {
288288
crate::schema::ProverKind::Rocq => 110,
289289
crate::schema::ProverKind::UppaalStratego => 111,
290290
crate::schema::ProverKind::MizAR => 112,
291+
crate::schema::ProverKind::GPUVerify => 113,
292+
crate::schema::ProverKind::Faial => 114,
293+
crate::schema::ProverKind::Leo3 => 115,
294+
crate::schema::ProverKind::Satallax => 116,
295+
crate::schema::ProverKind::Lash => 117,
296+
crate::schema::ProverKind::AgsyHOL => 118,
297+
crate::schema::ProverKind::IProver => 119,
298+
crate::schema::ProverKind::Princess => 120,
299+
crate::schema::ProverKind::Twee => 121,
300+
crate::schema::ProverKind::MetiTarski => 122,
301+
crate::schema::ProverKind::CSI => 123,
302+
crate::schema::ProverKind::AProVE => 124,
303+
crate::schema::ProverKind::GNATprove => 125,
304+
crate::schema::ProverKind::Stainless => 126,
305+
crate::schema::ProverKind::LiquidHaskell => 127,
306+
crate::schema::ProverKind::KeYmaeraX => 128,
307+
crate::schema::ProverKind::Qepcad => 129,
308+
crate::schema::ProverKind::Redlog => 130,
309+
crate::schema::ProverKind::MleanCoP => 131,
310+
crate::schema::ProverKind::IleanCoP => 132,
311+
crate::schema::ProverKind::NanoCoP => 133,
312+
crate::schema::ProverKind::MetTeL2 => 134,
313+
crate::schema::ProverKind::ELK => 135,
314+
crate::schema::ProverKind::Konclude => 136,
315+
crate::schema::ProverKind::Storm => 137,
316+
crate::schema::ProverKind::ProB => 138,
317+
crate::schema::ProverKind::EasyCrypt => 139,
318+
crate::schema::ProverKind::CryptoVerif => 140,
291319
}
292320
}
293321

@@ -407,6 +435,34 @@ pub fn ffi_to_prover_kind(ordinal: u8) -> Option<crate::schema::ProverKind> {
407435
110 => Some(crate::schema::ProverKind::Rocq),
408436
111 => Some(crate::schema::ProverKind::UppaalStratego),
409437
112 => Some(crate::schema::ProverKind::MizAR),
438+
113 => Some(crate::schema::ProverKind::GPUVerify),
439+
114 => Some(crate::schema::ProverKind::Faial),
440+
115 => Some(crate::schema::ProverKind::Leo3),
441+
116 => Some(crate::schema::ProverKind::Satallax),
442+
117 => Some(crate::schema::ProverKind::Lash),
443+
118 => Some(crate::schema::ProverKind::AgsyHOL),
444+
119 => Some(crate::schema::ProverKind::IProver),
445+
120 => Some(crate::schema::ProverKind::Princess),
446+
121 => Some(crate::schema::ProverKind::Twee),
447+
122 => Some(crate::schema::ProverKind::MetiTarski),
448+
123 => Some(crate::schema::ProverKind::CSI),
449+
124 => Some(crate::schema::ProverKind::AProVE),
450+
125 => Some(crate::schema::ProverKind::GNATprove),
451+
126 => Some(crate::schema::ProverKind::Stainless),
452+
127 => Some(crate::schema::ProverKind::LiquidHaskell),
453+
128 => Some(crate::schema::ProverKind::KeYmaeraX),
454+
129 => Some(crate::schema::ProverKind::Qepcad),
455+
130 => Some(crate::schema::ProverKind::Redlog),
456+
131 => Some(crate::schema::ProverKind::MleanCoP),
457+
132 => Some(crate::schema::ProverKind::IleanCoP),
458+
133 => Some(crate::schema::ProverKind::NanoCoP),
459+
134 => Some(crate::schema::ProverKind::MetTeL2),
460+
135 => Some(crate::schema::ProverKind::ELK),
461+
136 => Some(crate::schema::ProverKind::Konclude),
462+
137 => Some(crate::schema::ProverKind::Storm),
463+
138 => Some(crate::schema::ProverKind::ProB),
464+
139 => Some(crate::schema::ProverKind::EasyCrypt),
465+
140 => Some(crate::schema::ProverKind::CryptoVerif),
410466
_ => None,
411467
}
412468
}

src/interfaces/graphql/resolvers.rs

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,34 @@ impl ProverKindExt for crate::schema::ProverKind {
218218
CoreProverKind::Rocq => crate::schema::ProverKind::Rocq,
219219
CoreProverKind::UppaalStratego => crate::schema::ProverKind::UppaalStratego,
220220
CoreProverKind::MizAR => crate::schema::ProverKind::MizAR,
221+
CoreProverKind::GPUVerify => crate::schema::ProverKind::GPUVerify,
222+
CoreProverKind::Faial => crate::schema::ProverKind::Faial,
223+
CoreProverKind::Leo3 => crate::schema::ProverKind::Leo3,
224+
CoreProverKind::Satallax => crate::schema::ProverKind::Satallax,
225+
CoreProverKind::Lash => crate::schema::ProverKind::Lash,
226+
CoreProverKind::AgsyHOL => crate::schema::ProverKind::AgsyHOL,
227+
CoreProverKind::IProver => crate::schema::ProverKind::IProver,
228+
CoreProverKind::Princess => crate::schema::ProverKind::Princess,
229+
CoreProverKind::Twee => crate::schema::ProverKind::Twee,
230+
CoreProverKind::MetiTarski => crate::schema::ProverKind::MetiTarski,
231+
CoreProverKind::CSI => crate::schema::ProverKind::CSI,
232+
CoreProverKind::AProVE => crate::schema::ProverKind::AProVE,
233+
CoreProverKind::GNATprove => crate::schema::ProverKind::GNATprove,
234+
CoreProverKind::Stainless => crate::schema::ProverKind::Stainless,
235+
CoreProverKind::LiquidHaskell => crate::schema::ProverKind::LiquidHaskell,
236+
CoreProverKind::KeYmaeraX => crate::schema::ProverKind::KeYmaeraX,
237+
CoreProverKind::Qepcad => crate::schema::ProverKind::Qepcad,
238+
CoreProverKind::Redlog => crate::schema::ProverKind::Redlog,
239+
CoreProverKind::MleanCoP => crate::schema::ProverKind::MleanCoP,
240+
CoreProverKind::IleanCoP => crate::schema::ProverKind::IleanCoP,
241+
CoreProverKind::NanoCoP => crate::schema::ProverKind::NanoCoP,
242+
CoreProverKind::MetTeL2 => crate::schema::ProverKind::MetTeL2,
243+
CoreProverKind::ELK => crate::schema::ProverKind::ELK,
244+
CoreProverKind::Konclude => crate::schema::ProverKind::Konclude,
245+
CoreProverKind::Storm => crate::schema::ProverKind::Storm,
246+
CoreProverKind::ProB => crate::schema::ProverKind::ProB,
247+
CoreProverKind::EasyCrypt => crate::schema::ProverKind::EasyCrypt,
248+
CoreProverKind::CryptoVerif => crate::schema::ProverKind::CryptoVerif,
221249
}
222250
}
223251

@@ -336,6 +364,34 @@ impl ProverKindExt for crate::schema::ProverKind {
336364
crate::schema::ProverKind::Rocq => CoreProverKind::Rocq,
337365
crate::schema::ProverKind::UppaalStratego => CoreProverKind::UppaalStratego,
338366
crate::schema::ProverKind::MizAR => CoreProverKind::MizAR,
367+
crate::schema::ProverKind::GPUVerify => CoreProverKind::GPUVerify,
368+
crate::schema::ProverKind::Faial => CoreProverKind::Faial,
369+
crate::schema::ProverKind::Leo3 => CoreProverKind::Leo3,
370+
crate::schema::ProverKind::Satallax => CoreProverKind::Satallax,
371+
crate::schema::ProverKind::Lash => CoreProverKind::Lash,
372+
crate::schema::ProverKind::AgsyHOL => CoreProverKind::AgsyHOL,
373+
crate::schema::ProverKind::IProver => CoreProverKind::IProver,
374+
crate::schema::ProverKind::Princess => CoreProverKind::Princess,
375+
crate::schema::ProverKind::Twee => CoreProverKind::Twee,
376+
crate::schema::ProverKind::MetiTarski => CoreProverKind::MetiTarski,
377+
crate::schema::ProverKind::CSI => CoreProverKind::CSI,
378+
crate::schema::ProverKind::AProVE => CoreProverKind::AProVE,
379+
crate::schema::ProverKind::GNATprove => CoreProverKind::GNATprove,
380+
crate::schema::ProverKind::Stainless => CoreProverKind::Stainless,
381+
crate::schema::ProverKind::LiquidHaskell => CoreProverKind::LiquidHaskell,
382+
crate::schema::ProverKind::KeYmaeraX => CoreProverKind::KeYmaeraX,
383+
crate::schema::ProverKind::Qepcad => CoreProverKind::Qepcad,
384+
crate::schema::ProverKind::Redlog => CoreProverKind::Redlog,
385+
crate::schema::ProverKind::MleanCoP => CoreProverKind::MleanCoP,
386+
crate::schema::ProverKind::IleanCoP => CoreProverKind::IleanCoP,
387+
crate::schema::ProverKind::NanoCoP => CoreProverKind::NanoCoP,
388+
crate::schema::ProverKind::MetTeL2 => CoreProverKind::MetTeL2,
389+
crate::schema::ProverKind::ELK => CoreProverKind::ELK,
390+
crate::schema::ProverKind::Konclude => CoreProverKind::Konclude,
391+
crate::schema::ProverKind::Storm => CoreProverKind::Storm,
392+
crate::schema::ProverKind::ProB => CoreProverKind::ProB,
393+
crate::schema::ProverKind::EasyCrypt => CoreProverKind::EasyCrypt,
394+
crate::schema::ProverKind::CryptoVerif => CoreProverKind::CryptoVerif,
339395
}
340396
}
341397
}

src/interfaces/graphql/schema.rs

Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,34 @@ pub enum ProverKind {
123123
Rocq,
124124
UppaalStratego,
125125
MizAR,
126+
GPUVerify,
127+
Faial,
128+
Leo3,
129+
Satallax,
130+
Lash,
131+
AgsyHOL,
132+
IProver,
133+
Princess,
134+
Twee,
135+
MetiTarski,
136+
CSI,
137+
AProVE,
138+
GNATprove,
139+
Stainless,
140+
LiquidHaskell,
141+
KeYmaeraX,
142+
Qepcad,
143+
Redlog,
144+
MleanCoP,
145+
IleanCoP,
146+
NanoCoP,
147+
MetTeL2,
148+
ELK,
149+
Konclude,
150+
Storm,
151+
ProB,
152+
EasyCrypt,
153+
CryptoVerif,
126154
}
127155

128156
/// Status of a proof attempt
@@ -567,6 +595,34 @@ fn core_to_gql(kind: &CoreProverKind) -> ProverKind {
567595
CoreProverKind::Rocq => ProverKind::Rocq,
568596
CoreProverKind::UppaalStratego => ProverKind::UppaalStratego,
569597
CoreProverKind::MizAR => ProverKind::MizAR,
598+
CoreProverKind::GPUVerify => ProverKind::GPUVerify,
599+
CoreProverKind::Faial => ProverKind::Faial,
600+
CoreProverKind::Leo3 => ProverKind::Leo3,
601+
CoreProverKind::Satallax => ProverKind::Satallax,
602+
CoreProverKind::Lash => ProverKind::Lash,
603+
CoreProverKind::AgsyHOL => ProverKind::AgsyHOL,
604+
CoreProverKind::IProver => ProverKind::IProver,
605+
CoreProverKind::Princess => ProverKind::Princess,
606+
CoreProverKind::Twee => ProverKind::Twee,
607+
CoreProverKind::MetiTarski => ProverKind::MetiTarski,
608+
CoreProverKind::CSI => ProverKind::CSI,
609+
CoreProverKind::AProVE => ProverKind::AProVE,
610+
CoreProverKind::GNATprove => ProverKind::GNATprove,
611+
CoreProverKind::Stainless => ProverKind::Stainless,
612+
CoreProverKind::LiquidHaskell => ProverKind::LiquidHaskell,
613+
CoreProverKind::KeYmaeraX => ProverKind::KeYmaeraX,
614+
CoreProverKind::Qepcad => ProverKind::Qepcad,
615+
CoreProverKind::Redlog => ProverKind::Redlog,
616+
CoreProverKind::MleanCoP => ProverKind::MleanCoP,
617+
CoreProverKind::IleanCoP => ProverKind::IleanCoP,
618+
CoreProverKind::NanoCoP => ProverKind::NanoCoP,
619+
CoreProverKind::MetTeL2 => ProverKind::MetTeL2,
620+
CoreProverKind::ELK => ProverKind::ELK,
621+
CoreProverKind::Konclude => ProverKind::Konclude,
622+
CoreProverKind::Storm => ProverKind::Storm,
623+
CoreProverKind::ProB => ProverKind::ProB,
624+
CoreProverKind::EasyCrypt => ProverKind::EasyCrypt,
625+
CoreProverKind::CryptoVerif => ProverKind::CryptoVerif,
570626
}
571627
}
572628

@@ -685,5 +741,33 @@ fn gql_to_core(kind: &ProverKind) -> CoreProverKind {
685741
ProverKind::Rocq => CoreProverKind::Rocq,
686742
ProverKind::UppaalStratego => CoreProverKind::UppaalStratego,
687743
ProverKind::MizAR => CoreProverKind::MizAR,
744+
ProverKind::GPUVerify => CoreProverKind::GPUVerify,
745+
ProverKind::Faial => CoreProverKind::Faial,
746+
ProverKind::Leo3 => CoreProverKind::Leo3,
747+
ProverKind::Satallax => CoreProverKind::Satallax,
748+
ProverKind::Lash => CoreProverKind::Lash,
749+
ProverKind::AgsyHOL => CoreProverKind::AgsyHOL,
750+
ProverKind::IProver => CoreProverKind::IProver,
751+
ProverKind::Princess => CoreProverKind::Princess,
752+
ProverKind::Twee => CoreProverKind::Twee,
753+
ProverKind::MetiTarski => CoreProverKind::MetiTarski,
754+
ProverKind::CSI => CoreProverKind::CSI,
755+
ProverKind::AProVE => CoreProverKind::AProVE,
756+
ProverKind::GNATprove => CoreProverKind::GNATprove,
757+
ProverKind::Stainless => CoreProverKind::Stainless,
758+
ProverKind::LiquidHaskell => CoreProverKind::LiquidHaskell,
759+
ProverKind::KeYmaeraX => CoreProverKind::KeYmaeraX,
760+
ProverKind::Qepcad => CoreProverKind::Qepcad,
761+
ProverKind::Redlog => CoreProverKind::Redlog,
762+
ProverKind::MleanCoP => CoreProverKind::MleanCoP,
763+
ProverKind::IleanCoP => CoreProverKind::IleanCoP,
764+
ProverKind::NanoCoP => CoreProverKind::NanoCoP,
765+
ProverKind::MetTeL2 => CoreProverKind::MetTeL2,
766+
ProverKind::ELK => CoreProverKind::ELK,
767+
ProverKind::Konclude => CoreProverKind::Konclude,
768+
ProverKind::Storm => CoreProverKind::Storm,
769+
ProverKind::ProB => CoreProverKind::ProB,
770+
ProverKind::EasyCrypt => CoreProverKind::EasyCrypt,
771+
ProverKind::CryptoVerif => CoreProverKind::CryptoVerif,
688772
}
689773
}

src/rust/agent/swarm.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ use serde::{Deserialize, Serialize};
3434
use tokio::sync::{mpsc, Mutex};
3535
use tokio::task::JoinSet;
3636

37-
use crate::learning::design_search::{AnnealConfig, AnnealResult, DesignProblem};
37+
use crate::learning::design_search::{AnnealConfig, DesignProblem};
3838

3939
/// Configuration for a swarm run.
4040
#[derive(Debug, Clone, Serialize, Deserialize)]
@@ -152,6 +152,7 @@ fn delta_scalar(from: &[i64], to: &[i64]) -> f64 {
152152

153153
/// Run a swarm over `problem`. Returns the global best across agents
154154
/// plus per-agent reports.
155+
#[allow(clippy::type_complexity, clippy::needless_range_loop)]
155156
pub async fn run_swarm<P>(problem: Arc<P>, config: SwarmConfig) -> SwarmResult<P::State>
156157
where
157158
P: DesignProblem + Send + Sync + 'static,

src/rust/coprocessor/audio.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ fn dispatch_sync(op: CoprocessorOp) -> Result<CoprocessorOutcome> {
8080
duration_ms,
8181
sample_rate,
8282
} => {
83-
if sample_rate < 8_000 || sample_rate > 192_000 {
83+
if !(8_000..=192_000).contains(&sample_rate) {
8484
return Ok(CoprocessorOutcome::Failure(format!(
8585
"AudioSineWave: sample_rate {} outside [8000, 192000]",
8686
sample_rate
@@ -97,7 +97,7 @@ fn dispatch_sync(op: CoprocessorOp) -> Result<CoprocessorOutcome> {
9797
CoprocessorOutcome::Hex(hex(&wav_pack(&pcm, sample_rate)))
9898
}
9999
CoprocessorOp::AudioCompletionChime { sample_rate } => {
100-
if sample_rate < 8_000 || sample_rate > 192_000 {
100+
if !(8_000..=192_000).contains(&sample_rate) {
101101
return Ok(CoprocessorOutcome::Failure(format!(
102102
"AudioCompletionChime: sample_rate {} outside [8000, 192000]",
103103
sample_rate

src/rust/coprocessor/fpga.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! `yosys -p "synth -top <top_module>" <file>`, and returns the netlist
1414
//! output. Fail with a clear diagnostic if yosys is not on PATH.
1515
16-
use anyhow::{anyhow, Result};
16+
use anyhow::Result;
1717
use async_trait::async_trait;
1818
use std::io::Write;
1919
use std::process::Stdio;

src/rust/coprocessor/io.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
//! Path arguments are passed verbatim — caller is responsible for any path
1414
//! sanitisation (the prover-side trust pipeline does this before dispatch).
1515
16-
use anyhow::{anyhow, Result};
16+
use anyhow::Result;
1717
use async_trait::async_trait;
1818
use sha2::{Digest, Sha256};
1919
use tokio::fs;

src/rust/coprocessor/math.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -391,7 +391,7 @@ fn fib_fast_doubling(n: u64) -> BigUint {
391391
let (a, b) = helper(n / 2);
392392
let c = &a * (BigUint::from(2u32) * &b - &a);
393393
let d = &a * &a + &b * &b;
394-
if n % 2 == 0 {
394+
if n.is_multiple_of(2) {
395395
(c, d)
396396
} else {
397397
let e = &c + &d;

src/rust/coprocessor/physics.rs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,9 @@ fn rk4_step(kernel: &str, params: &[f64], x: &[f64], dt: f64) -> std::result::Re
129129
Ok(next)
130130
}
131131

132-
fn build_kernel(name: &str, params: &[f64]) -> std::result::Result<Box<dyn Fn(&[f64]) -> Vec<f64>>, String> {
132+
type KernelFn = Box<dyn Fn(&[f64]) -> Vec<f64>>;
133+
134+
fn build_kernel(name: &str, params: &[f64]) -> std::result::Result<KernelFn, String> {
133135
match name {
134136
"harmonic-oscillator" => {
135137
if params.len() != 1 {

0 commit comments

Comments
 (0)