Question
Your team wants to incrementally port a performance-critical C image-decoding library to Rust for memory safety, using an AI agent to translate functions. The agent produces Rust that compiles, but it's full of `unsafe` blocks and raw pointer arithmetic mirroring the C. How do you direct the agent and structure the port so you actually gain the safety you're migrating for, and how do you verify the Rust decodes identically to the C?
Treat the AI’s output as a draft to verify, not an answer to trust. Name the specific flaw and the input that triggers it, say how you’d catch it — tests, edge cases, reading critically — and how you’d re-prompt or decompose to get it right.
Vibe coding: describe the solution in plain language (or narrate it) and the coach grades your approach. Generating runnable code from your description is coming next.