跳到正文
DEV Community· Anushka Sharma·· 2 小時前AI 評分38

GhostCommit:找出程式碼中潛藏的問題

GhostCommit 👻 — Find What Haunts Your Code

AI 導讀

GhostCommit 是一個以萬聖節為主題的 AI 程式碼審查工作區,可掃描程式碼並提供問題説明、來源行及建議修改。它支援 Groq 雲端推理和 Ollama 本機推理,預設模型分別為 openai/gpt-oss-20b 和 qwen2.5-coder:3b;後端不會執行提交的程式碼。

正文

This is a submission for the Hacktoberfest Open-Source AI Challenge Week 4: Ghost in the Machine.

What I Built

Every codebase has a few ghosts: unfinished TODOs, confusing conditions, and functions that look harmless until something breaks.

I built GhostCommit, a haunted code-review workspace that turns investigating those problems into a small supernatural experience.

Paste code or upload a source file, click Scan for hauntings, and review the findings in a Haunting Report. Each finding includes an explanation and a source line to investigate. The Exorcism Patch provides suggested revised code for you to review and copy.

Features include:

Code input and local file selection.

AI-generated findings and explanations.

Suggested code changes.

Report export.

Browser-based scan history.

Groq and Ollama provider support.

The Halloween theme runs through the interface, from the “summoning circle” editor to the ghostly green palette. Underneath the spooky presentation, the goal is practical: make code review more approachable.

Demo

👻 Try GhostCommit : https://ghostcommit-vnt6.onrender.com/

Start with the included sample, then click Scan for hauntings to request an AI review.

The initial sample report is an illustration; an actual scan calls the configured AI provider. Findings and patches are suggestions to verify before using.

Code

💻 GitHub repository: https://github.com/Anushkasharma101/ghostcommit.git

The repository includes the frontend, backend, environment configuration example, tests, and deployment instructions.

How I Built It

I kept the stack lightweight:

Frontend: HTML, CSS, and JavaScript.

Backend: Node.js using its built-in HTTP server.

Cloud inference: Groq integration, configured by default for the open-weight openai/gpt-oss-20b model.

Local inference: Ollama support, with qwen2.5-coder:3b as its default model.

Deployment: Render serves the frontend and backend together.

The review flow is:

The frontend sends the source and selected language to the backend.

The backend validates the request and calls the configured provider.

The model returns structured findings and suggested code.

The backend validates that response before displaying it.

The AI performs the review itself—it supplies the explanations and proposed changes. It is central to the application.

I also added request limits, timeout handling, and clear errors for unavailable models, invalid credentials, and provider usage limits. The backend never executes submitted code.

Why Does Open Innovation Matter?

Open-weight models give GhostCommit a path beyond one hosted service.

Groq provides a convenient way to run cloud reviews without managing model hardware. Ollama offers a local option for developers who want to run an installed model on their own machine.

That flexibility matters because source code can be sensitive. Groq mode sends code to a cloud provider; local Ollama mode offers a different deployment choice. I wanted that distinction to be explicit.

The provider support also makes experimentation possible. I can change models, refine the review prompt, and compare results without rebuilding the interface.

The benefit is control over how the reviewer works and where inference happens.

The Spirit of It

I interpreted “Ghost in the Machine” as the unfinished business hiding inside software.

A forgotten TODO becomes a lingering spirit. A suspicious calculation becomes cursed logic. A proposed fix becomes an exorcism—but the developer still decides whether to perform it.

GhostCommit gives those everyday debugging moments a playful setting while keeping the useful work at the center.

Your code has unfinished business. 👻

Prize Categories

Best Use of Render — GhostCommit uses Render to host its frontend and Node.js API together.

來源:DEV Community · dev.to