feat(ai): add personal summary models and retire Q&A
Add an admin-managed provider model catalog with per-user summary selection, migration backfill, and generation snapshots. Retire report creation and messaging while preserving owner-scoped history. Refs #15 #16 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@ -33,3 +33,32 @@ func TestScheduledGenerationContinuesIndependentlyPerUser(t *testing.T) {
|
||||
t.Fatalf("scheduled identities=%v", g.ids)
|
||||
}
|
||||
}
|
||||
|
||||
type modelAvailabilityGenerator struct{ ids, selectedProviders []string }
|
||||
|
||||
func (g *modelAvailabilityGenerator) Generate(_ context.Context, id string) (generation.Result, error) {
|
||||
g.ids = append(g.ids, id)
|
||||
if id == "account-a" {
|
||||
return generation.Result{}, errors.New("summary_model_unavailable")
|
||||
}
|
||||
g.selectedProviders = append(g.selectedProviders, "provider-model-b")
|
||||
return generation.Result{}, nil
|
||||
}
|
||||
|
||||
type twoPersonalModelUsers struct{}
|
||||
|
||||
func (twoPersonalModelUsers) ListUsers() ([]models.User, error) {
|
||||
return []models.User{{ID: "account-a"}, {ID: "account-b"}}, nil
|
||||
}
|
||||
|
||||
func TestScheduledUnavailablePersonalModelFailsOneAccountAndContinuesOther(t *testing.T) {
|
||||
g := &modelAvailabilityGenerator{}
|
||||
s := &Scheduler{users: twoPersonalModelUsers{}, generationUseCase: g}
|
||||
s.run()
|
||||
if !reflect.DeepEqual(g.ids, []string{"account-a", "account-b"}) {
|
||||
t.Fatalf("scheduled account order=%v", g.ids)
|
||||
}
|
||||
if !reflect.DeepEqual(g.selectedProviders, []string{"provider-model-b"}) {
|
||||
t.Fatalf("scheduled selected providers=%v, unavailable account must not fall back", g.selectedProviders)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user