What is a bus factor (truck factor), and how do you raise it?
The bus factor is the smallest number of people who would have to leave before a project stalls because nobody left understands the code. It is a grim name for a planning question: where is our knowledge held by one head?
How it is measured from git history
Commit history cannot show who understands a file, but it shows who changed it. This tool adds up, per folder, the lines each person added and deleted. A single commit is capped at 500 lines per file so a generated or vendored dump cannot own a folder, and each change loses half its weight every 180 days so recent work counts for more. Bots, lock files, node_modules, vendor, dist and minified files are ignored. The folder's bus factor is the fewest people whose weighted changes reach half of its total. This is a heuristic line scan of history, not a measure of understanding.
The three statuses
orphaned — the largest contributor to a folder (at least half of it) has made no commit anywhere in the last 90 days. They may have left, moved teams or be on long leave. Find out, and assign an owner.
single-owner — one still-active person holds at least 80 percent of a folder. Nothing is wrong today; one absence away from a problem.
shared — more than one person carries the folder, or no one dominates it.
Five ways to raise it
Make the second person the reviewer on the next change in every single-owner folder.
Pair on one real change there instead of scheduling a handover meeting.
Write down what history cannot show: why it was built this way, how it is deployed, where the credentials live.
Hand the next bug or on-call rotation for that area to someone new.
Re-run the check monthly and watch the flagged list shrink; python3 busfactor.py --fail-on-orphaned works as a CI gate.
What this number does not tell you
Squashed commits credit one author for a team's work, pair programming credits one of two people, a contributor who commits under two emails counts as two, and an expert who reviews but rarely commits is invisible. Use the output to start a conversation about a folder, never to judge a person.