How the codebase study works
A script reads the Git repository of each open-source agent and counts its nonblank lines at every commit. It does not run the code, and it does not measure test coverage. The rules use file paths and file contents only, with no list per agent, so new code is classed the same way as old code. See the script.
What is counted
Every commit, every file.
- Every commit of the main branch, from the first one to today. A merged branch counts as one commit.
- Lines is every nonblank line of every text file. Source and Tests are code only.
- Changes count code only, and not a file that a commit moves without editing it.
- Per week is the mean number of commits per week over the last 12 weeks. Age is the days since the first commit.
- A file over 1k lines has more than 1,000 nonblank lines.
How a line is classed
The first rule that matches wins.
- Generated
- Files that the repository marks as generated or vendored in its
.gitattributes. Files in folders such asvendorandnode_modules, lock files and minified files. Files whose opening comment says that they are generated or not to be edited. Code files of 200 lines or more where 80% of the lines are only numbers and strings: data tables. - Fixtures
- Files in
fixtures,snapshotsortestdata, snapshot files, and files that are not code in a test folder. - Docs
- Markdown, files in a
docsfolder, and files that the repository marks as documentation. - Tests
- Code files with the word
test,testsore2ein a folder or file name, such astests/,*.test.tsortest_*.py. Also*.spec.tsfiles, and tests inside source files: Rust items marked#[test]or#[cfg(test)]and Zigtestblocks. - Comments
- Lines inside comments, found with a parser for Rust, TypeScript, JavaScript, Python, Go, Lua, Shell, C and Zig.
- Source
- The other lines of code files.
- Other
- Every other text file, such as configuration and schemas.
Line age
How long ago the lines that remain were last changed.
git blame runs on the last commit before each month
starts, and on the newest commit. Each line gets the age of the commit that
last changed it: under 7 days, 7 to 29, 30 to 89, 90 to 364, or a year and more.
How it runs
Every Monday, on GitHub.
- A GitHub workflow runs every Monday at 03:00 UTC, one job per agent. It reads only the commits that are new since the last run.
- New data replaces the old only if it passes checks. For example, the last commit of the old data must still be on the branch, and past days must not change.
- If the collection of an agent fails, that agent keeps its last data, and the run reports the failure.
- To add an agent, add a file to
codebase/harnesses/with its repository and branch.