Something went wrong. Try again.
An ATProto Powered Reputation Network
Something went wrong. Try again.
973 B · 36 lines
Go
at master
12345678910111213141516171819202122232425262728293031323334353637package reputation
import ( "context"
"provenance/internal/domain" "provenance/internal/trust")
// Trust supplies source-relative author scores through the service cache.type Trust interface { Score(context.Context, string) (trust.Result, error)}
// Algorithm aggregates direct assertions. Results have no trust-score clamp or single path.// Implementations must support concurrent requests and respect context cancellation and limits.type Algorithm interface { Describe() trust.Descriptor Calculate(context.Context, Input) (Result, error)}
type Input struct { Target string Vouches []domain.Vouch Threshold float64 Trust Trust Limits trust.Limits}
// AbsoluteScore is the signed sum, not its mathematical absolute value.// Score preserves the original sum field for existing clients.type Result struct { Score float64 `json:"score"` AbsoluteScore float64 `json:"absolute_score"` MeanScore float64 `json:"mean_score"`}