Inspiration
Most coding tools tell you what broke. None of them tell you why your brain made that mistake. We were tired of fixing bugs without understanding the thinking error behind them — and watching the same mistakes repeat. We wanted a tool that treats debugging as a cognitive problem, not just a syntax one.
What it does
WHY Engine runs a full analysis pipeline on your code — execution, static analysis, auto-generated test cases, and AI reasoning — then traces the bug back to the root cause in your thinking. You write down your approach before coding, and the engine compares your mental model against what you actually built, surfacing the gap. It gives you hints before solutions, multiple approaches, and a cognitive profile that tracks your recurring error patterns over time.
How we built it
A React frontend with Monaco editor, a Node.js/Express backend, Supabase for persistence, Judge0 for sandboxed code execution, and Groq (LLaMA) for the AI reasoning layer. The pipeline chains five engines: execution → static analysis → test case generation → LLM reasoning → delta comparison across attempts.
Challenges we ran into
Getting the AI to return structured, consistent JSON across different code languages and error types was harder than expected. Sandboxed execution with user-provided stdin required careful routing through the pipeline. Keeping the delta analysis meaningful across multiple attempts — rather than just noisy — took significant iteration.
Accomplishments that we're proud of
The pre-coding thinking comparison — where you write your approach first and the engine tells you exactly where your mental model diverged from your actual implementation. That felt genuinely new.
What we learned
The hardest part of debugging isn't the bug — it's the mental model that produced it. Building this forced us to think deeply about how to represent reasoning as structured data, not just code output.
What's next for Why-Engine
Expanding language support, a spaced-repetition system that resurfaces your personal error patterns, classroom/team mode for instructors to track student thinking trends, and deeper integration with competitive programming platforms like Codeforces and LeetCode.
Log in or sign up for Devpost to join the conversation.