package 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 }