Goal
Implement the curse_score tool — ranks files by risk using the formula:
curse_score = changes × log2(authors+1) × exp(-0.5 × age_years) × log2(churn_rate+2) × acceleration
Parameters
top (number, optional, default: 10) — number of files to return
since (string, optional) — time window filter
Implementation
- Run
git log --format='%H %an %ai' --numstat via ctx.$
- Parse output, compute per-file: change count, unique authors, recency, churn rate, acceleration
- Sort by score descending, return top N
- Exclude changelogs, lockfiles, CI config from results
- Return structured JSON with file paths, scores, and supporting stats
Tests
- Unit test with mocked git log output
- Verify curse formula computation
- Test
since filtering
- Test exclusion of lockfiles/changelogs
Goal
Implement the curse_score tool — ranks files by risk using the formula:
curse_score = changes × log2(authors+1) × exp(-0.5 × age_years) × log2(churn_rate+2) × acceleration
Parameters
top(number, optional, default: 10) — number of files to returnsince(string, optional) — time window filterImplementation
git log --format='%H %an %ai' --numstatviactx.$Tests
sincefiltering