Files
archie/internal/domain/sampling/staleness.go
T
sam 3c338a9722 refactor: strip doc and issue narration from code comments
Remove PRD/doc paths, bead IDs, phase notes and deleted-test references
from comments; drop test-only hooks left by the test deletion. Includes
in-progress archied bootstrap, gateway and query changes.
2026-10-03 21:47:46 +10:00

21 lines
786 B
Go

package sampling
import "context"
// stalenessSampler is the "staleness proxy" strategy: prefers content that
// hasn't been touched/reviewed in the longest time, i.e. the smallest
// Candidate.At first. It is a cheap proxy only -- callers decide what
// timestamp At holds (created, updated, or last-reviewed); this is never
// the embedding-based surprisal calculation.
type stalenessSampler struct{}
// NewStaleness builds the "staleness" strategy.
func NewStaleness() Sampler { return stalenessSampler{} }
func (stalenessSampler) Name() string { return "staleness" }
func (stalenessSampler) Sample(_ context.Context, candidates []Candidate, req Request) ([]Candidate, error) {
sorted := sortByTime(candidates, false)
return sorted[:effectiveCap(req.Cap, len(sorted))], nil
}