Something went wrong. Try again.
An ATProto Powered Reputation Network
Something went wrong. Try again.
1.1 kB · 49 lines
Go
at master
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950package trust
import ( "context"
"provenance/internal/domain")
// Algorithm calculates relative trust through supplied edges or a query-local graph reader.// Implementations must support concurrent requests and respect context cancellation and limits.type Algorithm interface { Describe() Descriptor Calculate(context.Context, Input) (Result, error)}
// NeighborAlgorithm accepts Input.Graph instead of a complete edge buffer.type NeighborAlgorithm interface { Algorithm UsesNeighbors()}
type Graph interface { Outgoing(context.Context, string, int) ([]domain.Vouch, error)}
// Account parameters declare identity lists for validation and API documentation.type AccountParameter struct { Name string Description string MaxItems int}
type Descriptor struct { Name string Accounts []AccountParameter}
type Accounts map[string][]string
// Input contains resolved DIDs only. Algorithms never resolve handles.type Input struct { Edges []domain.Vouch Source string Target string Limits Limits Accounts Accounts Graph Graph Budget *Budget}