fix: harden Rust FFI boundary#30
Conversation
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Overall validation and Arcade baselineThe focused engine suite is green: 41 tests passed (3 unit regressions + 38 integration tests). The updated source has no remaining I also ran Arcade Agent against a fresh cache on
These figures are an architecture baseline rather than a correctness verdict. The reported Proposal: add Arcade after Rust support is releasedArcade's public
I can send that follow-up workflow PR as soon as a released Rust-capable action is available. |
Closes #25.
What changed
transmutecalls from the engineWhy
The singleton setup/cleanup paths used
Mutex::lock().unwrap(), so a poisoned lock could panic at a C ABI boundary. The engine also relied on several unsafe primitive-to-enum transmutes. Both paths now fail safely without changing the public ABI.Validation
cargo testinvnkey-engine— 41 passedgit diff --check— passedrg 'std::mem::transmute|ENGINE\\.lock\\(\\)\\.unwrap' vnkey-engine/src— no matchescargo clippy --all-targets -- -D warningsremains blocked by 23 pre-existing lints (for examplebyte_char_slices,manual_range_contains, and existing public raw-pointer FFI warnings); this PR does not expand scope to rewrite those APIs.