use scry_analyze_core::{AnalysisConfig, StackBound, analyze};
fn fixture(rel: &str) -> std::path::PathBuf {
std::path::Path::new(env!("CARGO_MANIFEST_DIR"))
.join("../..")
.join(rel)
}
#[test]
fn scry_proves_msgq_shadow_stack_budget_383() {
let bytes = std::fs::read(fixture("scripts/repro/msgq_put_359.wasm"))
.expect("the #359/#383 gust-family fixture is in-tree");
let cfg = AnalysisConfig {
widening_threshold: None,
emit_diagnostics: false,
taint_policy: None,
};
let r = analyze(bytes, cfg).expect("scry analyzes a valid Core module");
assert_eq!(
r.stack_usage.max_stack_bytes,
StackBound::Bytes(32),
"scry's proven worst-case shadow-stack depth for msgq_put"
);
assert!(
!r.function_summaries.iter().any(|s| s.recursive),
"msgq_put has no reachable recursion → the budget is a finite proof"
);
assert!(
!r.reachable_from_exports.is_empty(),
"reachable_from_exports is the sound superset synth prunes against"
);
}