Repo Sage
RepoSage π β Project Summary & Architecture Walkthrough
MLH Hacktoberfest Hack Day Lahore Γ Fluxxion 2026
Category Target: Best Open-Source AI Project (Sponsored by DigitalOcean)
β‘ Executive Summary
βMost developers want AI to audit their code, but face two massive dealbreakers: pasting sensitive GitHub tokens into web applications, and AI models hallucinating files that do not exist.
We built RepoSage β a local-first, evidence-grounded repository auditor powered by open-weight Gemma 4 models. It connects natively to your existing GitHub CLI (
gh) with zero token pasting, computes an instant deterministic 0β100 Health Score, cross-verifies every AI claim against your actual Git tree to quarantine hallucinations, and lets you convert verified findings into real GitHub Issues in one click.β
π― The Core Problem & Our Innovation
| The Old Way (Generic LLMs & Web Linters) | The RepoSage Way |
|---|---|
| Token Risk: Requires pasting personal access tokens (PATs) into web UIs. |
Zero-PAT Friction: Natively bridges to your authenticated gh CLI session in-memory. Zero tokens saved or logged. |
| Hallucinated Audits: LLMs invent non-existent file paths and phantom vulnerabilities. | Anti-Hallucination Gate: Citation Verifier validates every AI claim against the recursive Git tree. Fake claims are quarantined. |
| Black Box Cloud Only: Forces proprietary models, sending sensitive private IP to external clouds. |
Dual-Runtime Open-Weight AI: Runs Gemma 4 E4B 100% locally on Ollama (air-gapped privacy) or Gemma 4 26B for deep analysis. |
| Vague Advice: Outputs long conversational text with no actionable follow-up. |
1-Click GitHub Remediation: Converts verified architectural findings directly into GitHub Issues via gh issue create. |
π οΈ How It Works (Step-by-Step Architecture)
[ User Machine ] ββ> [ gh CLI Bridge ] ββ> [ Evidence Collector (GraphQL) ]
β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββ΄ββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β 1. Deterministic Rule Engine β
β Calculates 0-100 Health Score across 6 dimensions (CI/CD, Tests, Security, Hygiene, Docs, Velocity) β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 2. Evidence Compiler & Privacy Redactor (SHA-256 Manifest) β
β Packages facts & sanitizes sensitive keys before AI inference β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 3. Gemma 4 Open-Weight AI Inference Engine β
β β’ Local Mode: Gemma 4 E4B via Ollama (100% private, zero internet needed) β
β β’ Cloud Mode: Gemma 4 26B via Google AI Studio (Deep architectural reasoning) β
β β’ Comparison Mode: Live benchmark comparing edge vs hosted weights on identical evidence β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ€
β 4. Anti-Hallucination Citation Verifier β
β Cross-checks every file mentioned by AI against real Git tree. Flagged if file doesn't exist! β
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
β
[ Real-time SSE Stream ] ββ> [ Next.js 15 Dashboard & 1-Click Issue Push ]
π₯οΈ 2-Minute Walkthrough & Demonstration Flow
-
Zero-Friction Onboarding (15s)
- Open RepoSage at
http://localhost:3000. - Point out: βNotice there is no login form or token prompt. RepoSage detected the local
ghsession instantly. All public and private repos within scope are accessible immediately.β
- Open RepoSage at
-
Select Repo & Run Audit (30s)
- Select a repository and click Run Audit.
- Observe the live Server-Sent Events (SSE) feed:
- Stage 1: Evidence collection (recursive Git tree + high-signal configs).
- Stage 2: Deterministic 0β100 score computed instantly (e.g. 78/100).
- Stage 3: Gemma 4 inference streaming in structured JSON.
-
The Anti-Hallucination Gate (30s)
- View the findings panel:
- βNotice how every single finding has a verified citation badge linking to an actual repository file. If an LLM hallucinates a file, our Citation Verifier catches it, strips it from the main plan, and flags it under telemetry.β
-
Dual-Runtime Comparison Mode (30s)
- Toggle to Comparison Mode:
- Compare
Gemma 4 E4B(running locally on Ollama in milliseconds) againstGemma 4 26B(running hosted). - Inspect latency, token throughput, and schema compliance metrics.
-
1-Click GitHub Remediation (15s)
- Click βCreate GitHub Issueβ on a high-priority finding.
- Converts the verified finding into a formatted, actionable issue directly on GitHub through the CLI bridge.
π Open-Source AI Challenge Alignment
-
Championing Open-Weight AI (Gemma 4):
- We avoid closed proprietary APIs. We demonstrate that open-weight small models (Gemma 4 E4B) running locally can perform production-grade code auditing when grounded with structured evidence.
-
Responsible AI by Design:
- Rather than relying on ungrounded generation, RepoSage implements a deterministic truth baseline and strict citation validation to eliminate hallucinations.
-
Full-Stack Engineering Polish:
- Decoupled monorepo with Next.js 15 (App Router), TypeScript, Tailwind CSS v4, Node.js/Express, Zod schema enforcement, and Server-Sent Events.
π‘ Frequently Asked Technical Questions (FAQ)
-
Q: Why not just paste the repository code into ChatGPT?
- A: Web chatbots have context window limits, lack access to full recursive Git trees, hallucinate files, and transmitting proprietary code violates privacy policies. RepoSage runs locally via Ollama with zero data leaving the host machine.
-
Q: What happens if the model endpoint is offline?
- A: RepoSage is resilient. The deterministic engine works 100% offline without any AI. For hosted mode, there is automatic Groq fallback, plus a built-in offline simulation mode.
-
Q: How do you prevent shell injection when running
ghcommands?- A: We use
child_process.execFilewith strict argument arrays and regex-validated input parameters (/^[a-zA-Z0-9_.-]+\/[a-zA-Z0-9_.-]+$/). Shell string interpolation is strictly avoided.
- A: We use
Built with
AI tools
Prize Categories Entered
- Submitted

Best Open-Source AI Project