package wing import ( "fmt" "github.com/mathiasbq/hyperguild/ingestion/internal/classification" ) // NewConfiguredResolver builds the production Resolver for a brain: Known from // the wiki, Eligible from classification.yaml (a wing is auto-assignable only // when it classifies below Confidential, so an untagged wing never is), the // LLM classifier over complete, and BM25 over the known wings as the scorer. // // Known is read once. A wing created later is unknown to this Resolver until // the process restarts, which fails safe: notes aimed at it are parked. func NewConfiguredResolver(brainDir string, complete CompleteFunc, threshold float64) (*Resolver, error) { known, err := KnownWings(brainDir) if err != nil { return nil, err } cls, err := classification.Load(brainDir) if err != nil { return nil, fmt.Errorf("load classification: %w", err) } return &Resolver{ Known: known, Eligible: func(w string) bool { return cls.Wing(w) < classification.Confidential }, Classifier: NewLLMClassifier(complete), Scorer: NewBM25Scorer(brainDir, known, ""), Threshold: threshold, }, nil }