Skip to content

Hackathons-ULT/bits-and-bobs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

119 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

RepoSense

AI-powered codebase health analysis, right inside VS Code.

Built with IBM Bob Β· IBM watsonx Orchestrate Β· watsonx.ai (Granite)


What It Does

Open any project in VS Code, click the RepoSense icon, get a full health report in minutes β€” without leaving your editor.

Panel What You Get
πŸ’― Health Score Score out of 100 with grade (A–F) and breakdown
πŸ—οΈ Architecture D3 module dependency graph, zoomable and clickable
πŸ” Code Review AI-detected issues with severity and file locations
πŸ“š Documentation Auto-generated function docs and unit test stubs
πŸ”’ Security Vulnerability detection and modernization priorities

Four IBM watsonx Orchestrate agents do the work β€” Architect, Reviewer, Documenter, Hardener β€” coordinated by a local FastAPI backend. Health scoring uses the Granite model on watsonx.ai.

Supported languages: Python, JavaScript, TypeScript.


Architecture

VS Code Extension (TypeScript)
    β”‚
    β”‚  HTTP (localhost:8000)
    β–Ό
FastAPI Backend (Python)
  β”œβ”€β”€ Parser β€” reads workspace files
  β”œβ”€β”€ Job Queue β€” tracks analysis state
  └── Orchestrate Client
            β”‚
            β”‚  IBM watsonx APIs
            β–Ό
    β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
    β”‚  watsonx Orchestrate              β”‚
    β”‚  β”œβ”€β”€ Architect Agent              β”‚
    β”‚  β”œβ”€β”€ Reviewer Agent               β”‚
    β”‚  β”œβ”€β”€ Documenter Agent             β”‚
    β”‚  └── Hardener Agent               β”‚
    β”‚                                   β”‚
    β”‚  watsonx.ai (Granite)             β”‚
    β”‚  └── Health Score Calculator      β”‚
    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Running Locally

Prerequisites

  • Python 3.11, 3.12, or 3.13 (constrained by ibm-watsonx-ai==1.5.11 which requires >=3.11,<3.14). Install from python.org.
  • Node.js 18+ (LTS recommended). Install from nodejs.org.
  • VS Code with the code command in PATH.
    • macOS: open VS Code β†’ Cmd+Shift+P β†’ "Shell Command: Install 'code' command in PATH".
    • Windows: re-run the VS Code installer and check "Add to PATH".
  • bash (built-in on macOS/Linux; on Windows install Git for Windows and run from Git Bash).
  • IBM watsonx credentials (entered via the in-app setup wizard β€” no manual .env editing required).

Quick Start (Recommended)

Execute run.sh from the repo root to set up everything and launch the application:

./run.sh

The script will:

  1. Check prerequisites β€” Python (correct version), Node.js, npm, code CLI, port 8000. Bails early with a clear message if anything's missing.
  2. Create a Python virtual environment in venv/ using a compatible Python.
  3. Install backend dependencies from backend/requirements.txt.
  4. Install extension dependencies with npm install and compile the TypeScript.
  5. Start the uvicorn backend on http://localhost:8000 and wait until it actually responds (not just "process exists").
  6. Launch VS Code with the extension loaded in development mode.

The backend keeps running in the background. Press Ctrl+C to stop the launcher; the backend's PID is printed so you can kill it when you're done.

On first launch, the RepoSense sidebar shows a setup wizard for your watsonx credentials. The wizard writes them to backend/.env and reloads settings in memory.

Manual Setup

If you prefer to run components separately:

1. Start the backend

cd backend
pip install -r requirements.txt
uvicorn src.main:app --reload

Backend runs on http://localhost:8000. Verify:

curl http://localhost:8000/
# {"service":"RepoSense API","status":"running","version":"1.0.0"}

2. Run the extension

cd vscode-extension
npm install

Press F5 in VS Code to launch the Extension Development Host, open any project folder, and click the RepoSense icon in the sidebar.

3. Configure credentials

On first launch, the sidebar shows a setup wizard. Enter your watsonx credentials there β€” the extension posts them to /config/setup, which persists them to backend/.env and reloads settings in memory. No manual .env editing required.

If you'd rather pre-populate .env yourself, copy backend/.env.example to backend/.env and fill in the real values (not the placeholder strings β€” the backend treats non-empty placeholders as "configured" and skips the wizard).


API Reference

POST /analyze

Start analysis on a local path.

{ "local_path": "/absolute/path/to/project" }

Returns:

{ "type": "request", "job_id": "abc-123", "progress": [...] }

GET /jobs/{job_id}

Poll for status. While running, returns type: "request" with current progress steps. On completion, type: "result" with the full payload:

{
  "type": "result",
  "job_id": "abc-123",
  "progress": [...],
  "payload": {
    "score":        { "score": 74, "grade": "B", "breakdown": {...}, "summary": "...", "top_priorities": [...] },
    "architecture": { "nodes": [...], "edges": [...] },
    "review":       { "findings": [...] },
    "docs":         { "docs": [...], "tests": [...] },
    "security":     { "security": [...], "modernization": [...] }
  }
}

On failure, type: "error" with a code, message, and the stage that failed.

DELETE /jobs/{job_id}

Remove a job from the in-memory store.

POST /cleanup

Manually trigger cleanup of jobs older than JOB_RETENTION_HOURS (default 24). Returns { "removed": <count> }.

GET /config/status

Check whether all required watsonx credentials are set. Returns { "configured": bool, "missing_fields": [...] }. The VS Code extension calls this on launch to decide whether to show its setup wizard.

POST /config/setup

Persist any subset of watsonx credentials. Non-empty values are written to backend/.env and reloaded in memory. Returns the same shape as /config/status.


Environment Variables

See .env.example for the full list. Required:

# watsonx Orchestrate (agents)
ORCHESTRATE_API_KEY=
ORCHESTRATE_URL=https://api.us-south.watson-orchestrate.cloud.ibm.com
ORCHESTRATE_INSTANCE_ID=
ORCHESTRATE_AGENT_ARCHITECT_ID=
ORCHESTRATE_AGENT_REVIEWER_ID=
ORCHESTRATE_AGENT_DOCUMENTER_ID=
ORCHESTRATE_AGENT_HARDENER_ID=

# watsonx.ai (health scoring)
WATSONX_API_KEY=
WATSONX_PROJECT_ID=
WATSONX_URL=https://us-south.ml.cloud.ibm.com

The Orchestrate client exchanges your API key for an IBM IAM bearer token on demand β€” no manual token handling required.


IBM Bob Usage

Built entirely with IBM Bob IDE. Session exports for all 6 team members are in bob_sessions/, organized by role (P1–P6).


Team

Member Role
P1 Backend β€” FastAPI, job queue, parser
P2 Orchestrate β€” four AI agent implementations
P3 AI β€” health scoring with watsonx.ai Granite
P4 Extension β€” VS Code extension core
P5 Webview β€” interactive panels with D3.js
P6 Integration, demo, submission

License

Built for the IBM Bob Hackathon 2026. See repository for license details.


IBM Bob Hackathon 2026

About

A repo for the IBM Bob hackathon

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors