Inspiration
The inspiration comes from my own hardships while programming. Recently, short on time, I started using AI to modernize and automate as much of my life as possible by building brainstorming agents, programming agents, task agents, and a dear personal assistant.
But vibe coding has a persistent flaw, the logical errors the programming agent leaves behind which I like to call "loose ends", coming from the loose threads in a fabric that keep it from lying perfectly smooth. Programmers waste hours debugging AI code and stitching it into the rest of a codebase, precisely because the AI fails to account for all the extra flows a real system has to handle. LooseEnds exists to catch those threads before they unravel the merge.
What it does
LooseEnds is not just a prompt wrapper but rather an Execution-Guided AI Code Auditor built to make AI code production-ready.
When a user pastes a block of AI-generated code, LooseEnds runs a three-phase pipeline:
- Static & Security Review: Using Nebius (NVIDIA Nemotron), it scans for logic holes, security risks (like SQL injection), convention violations, and missing edge-case flows.
- Autonomous Fuzzing Loop: The backend actually runs the code against a matrix of malicious inputs (None, strings, negative numbers). When the code crashes, the AI reads the traceback, generates a fix, auto-applies it, and re-runs the fuzzer until the code is bulletproof.
- The Memory Vault (Self-Learning): If the user notices the AI made a mistake, they can provide feedback. LooseEnds distills this feedback into a generalized "Golden Rule," saves it to a database, and injects it into every future prompt. It learns your team's coding standards permanently. The Output: A fully auto-patched block of code, a timeline of what the engine did, and a prioritized report of every issue found.
How I built it
LooseEnds is a full-stack application split into a React frontend and a Django REST backend.
The Frontend: I built the frontend with React and Vite and a monaco editor (the engine behind VS Code) embedded directly into the browser for a native coding experience, with a custom looseends-dark theme.
Three.js for the interactive 3D neural network background (thick glowing threads with traveling light pulses, meant to represent the structure of Artificial and natural brain processing information but instead of neurons, threads are the one interconnected with each other), rendered on a native WebGL canvas. Frosted Glassmorphism UI with full Light/Dark mode support, persisted via localStorage. A live Engine Execution Timeline that shows the user exactly what the backend is doing (fuzzing, auto-fixing, reviewing).
The Backend: I built the backend with Django and Django REST Framework. Pydantic validates the JSON schema returned by the model, ensuring the frontend never receives malformed data. Python's ast module parses the user's code to automatically detect every function definition and generate dynamic fuzz tests then subprocess + pytest actually executes the code in an isolated temporary directory to catch real runtime crashes. Finally an SQLite database stores the "Memory Vault" of Golden Rules learned from user feedback. Nebius Token Factory (NVIDIA Nemotron) is used for inference. The llm_client.py is built with a model-agnostic fallback layer, so it can seamlessly swap between Nebius, Ollama, and any OpenAI-compatible endpoint by simply changing the .env file.
Challenges I ran into
There were ALOT but the ones that really got on my nerves and were difficult to fix were:
The AI hallucinating syntax fixes: Early on, the AI would suggest fixes with \n as a literal string, which broke the indentation when applied. I solved this by writing a smart indentation pipeline in App.jsx and views.py that detects the base indentation of the target line, splits the fix into real lines, and applies the exact scope.
Getting LLMs to return strict JSON: Asking the model nicely wasn't enough. I had to implement a Pydantic validation layer on the backend that strips markdown fences, fixes trailing commas, and retries if the output violates the schema. When deployed on Nebius, we use decoding-level json_schema enforcement; when deployed on Ollama, we inject the schema directly into the prompt.
Infinite Fuzzer Loops: The AI would "fix" a crash, but introduce a new edge case (like trying to use data or [] instead of isinstance(data, list)). I capped the fuzzer at 5 iterations and added a SELF-HEALING traceback injection that forces the AI to read the actual crash log before writing the next fix.
The "Fake Fix" problem: The AI kept giving the code the exact same bugs it received. I had to build a separate Static Auto-Fix phase that applies the AI's static analysis suggestions back to the code before the fuzzer even runs.
I also had to figure out how to deal with the fact that this is also AI and it could also make mistakes so I took more than one model and had all of them run the entire pipeline many times to find the best possible solution
Accomplishments that I am proud of
The Self-Learning Memory Vault: Instead of fine-tuning a model (which takes days and GPUs), which was my first thought to make it self learn but that had ofcourse a problem already mentioned, instead I built a system where the model learns from feedback in real-time. Every rule the AI learns is stored in a database and injected into the next prompt. It's model-agnostic—you can swap the AI provider tomorrow, and the new model inherits all previous lessons.
The Autonomous Fuzzing Loop: LooseEnds doesn't just ask the AI to write tests. It actually executes the code, catches the traceback, auto-patches the code, and runs the tests again until they pass. Seeing the Monaco editor fix itself in real time is genuinely satisfying.
The UI: A fully custom frosted-glass UI with a 3D neural network background, a functional Monaco Editor with a bespoke syntax theme, and a real-time timeline that makes the AI's "thought process" visible to the user. It was meant to convey a feel for that "techy AI" vibe
The System Integration: The whole app is tied together perfectly. The React frontend sends a single payload, the Django backend does all the heavy lifting, and the user gets a fully patched, bulletproof version of their code. I tried to polish it as best I could and add improve this on an extremely better basis but I unfortunately had an exam and ran out of time however I will still work on this project
What I learned
LLMs are REALLY bad at math but great at reasoning: The AI would frequently get line numbers wrong or miscount indentation. But when given a raw Python traceback from a fuzzer, it was incredibly good at diagnosing the root cause. Execution-guided AI is significantly more reliable than prompt-only AI.
Strict schemas are non-negotiable: The first thing I had to build was a robust validator. Without it, the frontend would crash on every edge case. Pydantic saved the entire project. Feedback is the missing link: Asking an AI to generate code is easy. Training it to generate your code, personalised for you , with your team's conventions, and personalised for your team , requires a persistent memory layer. That's where the real value of LooseEnds lies.
Hackathon speed requires ruthless scope: I originally wanted to build AST-based auto-refactoring, a full repo scanner, and an IDE plugin. I had to cut all of that to focus on the one thing that matters, making the AI code work.
What's next for LooseEnds
I have alot planned for this as I will use this myself along with all my friends as well
Scale scanning: Currently LooseEnds can only work with a small block of code, which is not sufficient enough for actual industry standard projects as I have worked on alot of software currently in use and I can say that LooseEnds would not be effective. However I will scale it to at one point look at an entire project worth of code and find all the LooseEnds in that code.
Agentic Pipeline: LooseEnds will eventually be integrated into a pipeline full of agents like LooseEnds that will help small businesses and young programmers to learn and have access to top tier code like tech monsters so they have somewhat of a fighting chance. This pipeline will include an idea generator agent, idea validator agent, idea expander agent, Code generator agent, LooseEnds, Reviewing agent, Publishing agent, Management agent and etc
Log in or sign up for Devpost to join the conversation.