Skip to content

About

Score GitHub accounts and pull requests for agent karma farming (0.0 to 1.0)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

1 Commit

Folders and files

Repository files navigation

Karma Farmer

Karma Farmer is a command line tool that gives a 0.0 to 1.0 triage score for how likely a GitHub account, or a pull request, is to be an agent karma farmer: an account whose activity is automated bulk repository creation, forking, and drive-by pull requests filed shortly after an issue is opened.

The score is a heuristic triage signal, not proof. Every signal is printed with its raw value so a human can check the reasoning.

Using

Install

Karma Farmer is managed with uv.

% uv sync

Command Line

Provide --user, --pr, or both.

Score a user
% uv run karma-farmer --user leninworld
Score a pull request, as a URL or as org/repo#N
% uv run karma-farmer --pr https://github.com/delta-io/delta-rs/pull/5132
% uv run karma-farmer --pr delta-io/delta-rs#5132
Combine both, and fail when the score is above a threshold
% uv run karma-farmer --user leninworld --pr delta-io/delta-rs#5132 --threshold 0.5

Options:

Option Purpose

--user LOGIN

GitHub login to examine

--pr REF

Pull request as a full URL or org/repo#N

--threshold FLOAT

Exit with status 1 when the score is above this value (0.0 to 1.0)

--json

Print the full report as JSON

Exit status:

Status Meaning

0

Scored successfully, and at or below the threshold if one was given

1

Score is above --threshold

2

Invalid arguments, or the user or PR could not be fetched

Authentication

The tool reads GITHUB_TOKEN if it is set, and otherwise asks gh auth token. Without a token GitHub limits requests to 60 per hour.

How the score works

Each signal is normalised to 0.0 to 1.0, and the final score is a weighted mean over the signals that were measured.

Profile signals

account age, repos created in the last 90 and 180 days, share of repos created recently (dormancy break), fork ratio, zero-star ratio, write-type public events in the last seven days, and distinct repos touched in recent events.

Pull request signals

hours between the linked issue and the PR, whether the author is a first-time contributor, and whether the body carries AI-generation boilerplate.

Bot accounts are excluded and score 0.0.

Labels:

Score Label

0.75 and above

likely karma farmer

0.50 to 0.75

suspicious, review manually

0.40 to 0.50

weak signal

below 0.40

consistent with authentic contributors

Development

Dependencies are managed with uv, and tests use pytest.

% uv sync
% uv run pytest
% uv run pytest --cov=karma_farmer --cov-report=term-missing

The scoring logic in scoring.py is pure and takes plain data objects, so it is tested without network access. github_client.py is the only module that talks to GitHub, through PyGithub, and its tests use fake objects.

Layout

Path Contents

src/karma_farmer/scoring.py

Signal definitions, weights, and labels (pure functions)

src/karma_farmer/github_client.py

PyGithub access, PR reference parsing, token resolution

src/karma_farmer/models.py

Plain data objects passed between the client and the scorer

src/karma_farmer/cli.py

Command line entry point

tests/

Unit tests

Licensing

This repository is licensed under the MIT License. See LICENSE.

About

Score GitHub accounts and pull requests for agent karma farming (0.0 to 1.0)

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages