Skip to content

Latest commit

 

History

2 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

⏳ TimeMachine

Git archaeology for any function. In any language. Narrated by AI.

Built for the IBM Bob Hackathon · May 2026


What it does

  1. Paste a public GitHub URL → repo clones in seconds
  2. Click any file → functions extracted via AST (JS/TS) or regex (everything else)
  3. Click any function → complete git history of just those lines via git log -L
  4. IBM watsonx.ai (Granite 3) generates:
    • 🎬 A narrative story of how the function evolved
    • 🔍 Patterns detected (bug magnets, bus factor, security hotspots)
    • ⚠️ Risk level + reasoning
    • 📋 Prioritized recommendations

Languages supported

JavaScript · TypeScript · JSX · TSX · Python · Java · Go · Ruby · Rust · Kotlin · Swift · C# · C · C++ · Scala · PHP · Lua

JS/TS uses Babel AST. Others use carefully-tuned regex parsers — accurate enough for archaeology, fast to run.

How IBM Bob IDE was used

Bob IDE was my pair programmer throughout. See bob_sessions/ for full exports.

What Bob did File
Designed the git log -L output parser git-archaeology.js
Built the multi-language dispatch pattern parsers/index.js
Tuned regex patterns for each language parsers/index.js
Wrote IAM token caching logic watsonx.js
Designed JSON repair for truncated AI output watsonx.js
Caught race condition in concurrent clones repo-cache.js
Engineered the mock fallback strategy mocks.js

Quick start

npm install
cp .env.example .env
# Edit .env: add WATSONX_API_KEY and WATSONX_PROJECT_ID
node scripts/setup-check.js
npm start
# Open http://localhost:3000

Works without API keys thanks to deterministic mock responses.

Environment variables

Variable Required Where to get it
WATSONX_API_KEY ⭐ for real AI https://cloud.ibm.com/iam/apikeys
WATSONX_PROJECT_ID ⭐ for real AI watsonx.ai → project → Manage tab
WATSONX_URL optional defaults to https://us-south.ml.cloud.ibm.com
GITHUB_TOKEN optional for private repos / higher rate limits
USE_MOCK optional true to force mock mode

API

POST /api/analyze   { url }                            → file tree + langs
POST /api/functions { url, file }                       → functions[]
POST /api/history   { url, file, startLine, endLine }   → commits[]
POST /api/narrate   { commits, fnInfo }                 → narrative + recs

Project structure

timemachine/
├── src/
│   ├── server.js              Express server + 4 endpoints
│   ├── repo-cache.js          GitHub clone + cache + URL validation
│   ├── git-archaeology.js     git log -L parser + commit classifier
│   ├── watsonx.js             IBM Granite 3 + JSON repair + fallback
│   ├── mocks.js               Deterministic mock AI
│   └── parsers/
│       └── index.js           Multi-language function extraction
├── public/
│   ├── index.html             UI
│   ├── styles.css             Dark IBM-aligned theme
│   └── app.js                 Frontend logic
├── test/
│   └── test-pipeline.js       Integration tests
├── scripts/
│   └── setup-check.js         Pre-flight env check
├── bob_sessions/              Exported IBM Bob IDE sessions
├── .env.example
├── package.json
└── README.md

License

MIT

About

Git archaeology for any function. Narrated by IBM watsonx.ai.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages