Git archaeology for any function. In any language. Narrated by AI.
Built for the IBM Bob Hackathon · May 2026
- Paste a public GitHub URL → repo clones in seconds
- Click any file → functions extracted via AST (JS/TS) or regex (everything else)
- Click any function → complete git history of just those lines via
git log -L - 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
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.
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 |
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:3000Works without API keys thanks to deterministic mock responses.
| 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 |
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
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
MIT