score

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 22, 2026 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package score implements the standalone reputation scoring model using a v2 risk-weighted categorical algorithm. It exposes Compute, Signals, category weights, and ModelVersion.

Index

Constants

View Source
const ModelVersion = "2.0.0"

ModelVersion is the current scoring model version.

Variables

View Source
var (
	CategoryProvenanceWeight = provenanceWeight
	CategoryIdentityWeight   = ageWeight + orgMemberWeight
	CategoryEngagementWeight = proportionWeight + recencyWeight
	CategoryCommunityWeight  = followerWeight + repoCountWeight
)

Exported category weights derived from signal constants above.

Functions

func Compute

func Compute(s Signals) float64

Compute returns a reputation score in [0.0, 1.0] using the v2 weighted model.

Types

type CategoryWeight

type CategoryWeight struct {
	Name   string  `json:"name" yaml:"name"`
	Weight float64 `json:"weight" yaml:"weight"`
}

CategoryWeight describes a scoring category and its weight.

func Categories

func Categories() []CategoryWeight

Categories returns the model's scoring categories with their weights.

type Signals

type Signals struct {
	Suspended         bool  // Account suspended
	StrongAuth        bool  // 2FA enabled
	Commits           int64 // Author's commit count
	UnverifiedCommits int64 // Commits without verified signatures
	TotalCommits      int64 // Repo-wide total commits
	TotalContributors int   // Repo-wide contributor count
	AgeDays           int64 // Days since account creation
	OrgMember         bool  // Member of repo owner's org
	LastCommitDays    int64 // Days since most recent commit
	Followers         int64 // GitHub follower count
	Following         int64 // Following count (for ratio)
	PublicRepos       int64 // Public repository count
	PrivateRepos      int64 // Private repository count
}

Signals holds the raw inputs to the reputation model.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL