feat(generation): select articles in three passes

This commit is contained in:
2026-11-24 00:38:02 +01:00
parent d22f84529f
commit 8022ee0547
27 changed files with 916 additions and 68 deletions

View File

@ -140,7 +140,7 @@ func TestUseCaseIsolatesTwoUsersAndUsesOnlyEnabledSourcesAndUserInputs(t *testin
}
}
func TestUseCasePreservesLayaOrderThenAppliesPerSourceAndGlobalCaps(t *testing.T) {
func TestUseCasePreservesRecentInputOrderWithSourcePoolsAndGlobalOutputCap(t *testing.T) {
articles := []scraper.Article{
{Title: "a1"}, {Title: "a2"}, {Title: "b1"}, {Title: "a3"}, {Title: "b2"},
}
@ -157,7 +157,7 @@ func TestUseCasePreservesLayaOrderThenAppliesPerSourceAndGlobalCaps(t *testing.T
t.Fatalf("summary calls=%d, want 1", len(summarizer.articles))
}
got := candidateTitles(summarizer.articles[0])
want := []string{"a2", "b1", "b2"}
want := []string{"a1", "b1", "a3"}
if !reflect.DeepEqual(got, want) {
t.Fatalf("rank order/caps got %v, want %v", got, want)
}