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:
2026-11-21 20:45:21 +01:00
parent ac17d27f51
commit 989996fbd6
53 changed files with 2228 additions and 979 deletions

View File

@ -76,6 +76,7 @@ test('admin creates a user who follows a fake index and generates a private summ
await test.step('user saves language and ranking preferences', async () => {
await page.goto(new URL('/preferences', baseURL).href)
await page.getByLabel('Langue des synthèses').selectOption('en')
await page.getByLabel('Modèle de synthèse', { exact: true }).selectOption(fixture.summaryModelID)
await page.getByLabel('Informations utilisées par Laya pour classer les articles').selectOption('title_content')
await page.getByRole('button', { name: 'Enregistrer' }).click()
await expect(page.getByRole('status')).toHaveText('Préférences enregistrées.')
@ -117,6 +118,12 @@ test('admin creates a user who follows a fake index and generates a private summ
expect(generations.data.length).toBe(1)
const outcome = generations.data[0].outcome
expect(outcome.status).toBe('succeeded')
const summaries = await request.get(new URL('/api/summaries', stack.apiUrl).href, { headers: { Authorization: `Bearer ${token}` } })
const saved = await summaries.json()
expect(saved.data[0].summary_model_id).toBe(fixture.summaryModelID)
expect(saved.data[0].provider_name).toBe('ollama')
expect(saved.data[0].model_name).toBe('fake-summary')
expect(events.events.filter(event => event.kind === 'layaSummaryCalls').every(event => event.model === 'fake-summary')).toBeTruthy()
expect(outcome.total_candidates).toBe(1)
expect(outcome.source_stats).toHaveLength(1)
const serialized = JSON.stringify(outcome)