Documentation
¶
Index ¶
- Constants
- Variables
- func Categories(s InputSignals, hasRepo bool, beh *model.Behavior) map[string]float64
- func Compute(s InputSignals, hasRepo bool, beh *model.Behavior) float64
- func ComputeTier2Heuristics(beh *model.Behavior, s *InputSignals) *model.BehavioralHeuristics
- func Grade(score float64) string
- type InputSignals
Constants ¶
View Source
const ( CategoryIdentity = "identity" CategoryEngagement = "engagement" CategoryCommunity = "community" CategoryBehavioral = "behavioral" CategoryCodeProvenance = "code_provenance" )
Category name constants used as keys in the per-category map.
Variables ¶
View Source
var ( CategoryProvenanceWeight = provenanceWeight CategoryIdentityWeight = ageWeight + associationWeight + profileWeight CategoryEngagementWeight = proportionWeight + recencyWeight + prAcceptWeight CategoryCommunityWeight = followerWeight + repoCountWeight CategoryBehavioralWeight = consistencyWeight + reviewParticipWeight + repoDiversityWeight + burstWeight + forkOnlyWeight )
Exported category weights derived from signal constants.
Functions ¶
func Categories ¶
Categories returns per-category scores for the given signals. When hasRepo is false, repo-dependent categories are omitted (not zero).
func Compute ¶
func Compute(s InputSignals, hasRepo bool, beh *model.Behavior) float64
Compute returns a reputation score in [0.0, 1.0] using the v3 weighted model. When hasRepo is false, repo-dependent signal weights are redistributed across available signals so the score reflects what can actually be evaluated.
func ComputeTier2Heuristics ¶
func ComputeTier2Heuristics(beh *model.Behavior, s *InputSignals) *model.BehavioralHeuristics
ComputeTier2Heuristics computes AI sensing behavioral heuristics from the Behavior struct and InputSignals. Safe to call with nil arguments.
Types ¶
type InputSignals ¶
type InputSignals struct {
// Identity
AgeDays int64
AuthorAssociation string
HasBio bool
HasCompany bool
HasLocation bool
HasWebsite bool
HasPublicEmail bool
// Engagement
Commits int64
TotalCommits int64
TotalContributors int
LastCommitDays int64
PRsMerged int64
PRsClosed int64
// Community
Followers int64
Following int64
PublicRepos int64
// Behavioral
RecentPRRepoCount int64
ForkedRepos int64
// Provenance
UnverifiedCommits int64
// Flags
Suspended bool
OrgMember bool
TrustedOrgMember bool
// Partial is true when one or more sub-fetches failed during signal
// collection (e.g., a Search-API rate-limit hit). It is transient
// (not persisted via JSON) so the scorer can decide whether to mark
// the score as non-deep / shorten its cache lifetime without
// polluting the historical signals record.
Partial bool `json:"-"`
}
InputSignals holds the raw inputs to the reputation model.
Click to show internal directories.
Click to hide internal directories.