304 Commits (ab643c8e4ca254acbd058078b9357a2eed6e0fd1)
 

Author SHA1 Message Date
oabrivard ab643c8e4c Fixe Markdown lint issues 2 months ago
oabrivard ad613aa001 fix: resolve all markdownlint errors (blank lines, table spacing, bare URLs)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
oabrivard 0963559e0f fix: resolve all clippy warnings in test files (zero warnings remaining)
- api_auth_test.rs: replace len() > 0 with !is_empty() (3 occurrences)
- api_admin_test.rs: suppress type_complexity on complex tuple Vec annotation
- api_sources_preferred_test.rs: replace assert_eq!(x, false) with assert!(!x)
- api_sources_test.rs: remove needless & on format!() in .uri() calls (5 occurrences)
- api_syntheses_test.rs: remove needless & on format!() in .uri() call

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
oabrivard 9a734f136e fix: resolve all clippy warnings (0 remaining)
- db/themes: pass CreateThemeRequest/UpdateThemeRequest structs instead
  of 8-9 individual parameters
- llm/mock: add Default impl for MockLlmProvider
- middleware/auth: suppress manual_async_fn (Axum extractor constraint)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard c6aa1afdc5 refactor: decompose ThemeSourceList into SourceAddForm + SourceImport
ThemeSourceList: 477 → 222 lines (source list + preferred + delete)
SourceAddForm: 114 lines (title + URL form)
SourceImport: 186 lines (CSV import/export + bulk text import)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 3d790e7ce7 feat: extract article URLs from JSON-LD structured data in source pages
Many modern sites (Hugo, WordPress, Next.js) load articles via JavaScript
but include full article URLs in JSON-LD schema.org markup in the <head>.
The scraper now extracts these first (highest quality), then falls back
to <a href> heuristic extraction. Supports ItemList, BlogPosting,
NewsArticle, @graph arrays, and mainEntity wrappers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 9a310bbf19 feat: add French/European/US date formats + remove "Articles sans date" category
Date parser now supports: 25/03/2026, 25-03-2026, March 25 2026,
25 mars 2026, 15 février 2026, and short month variants.

Articles without dates are no longer routed to a separate category —
they stay in their LLM-classified category with date shown as empty.
This prevents losing good articles in a catch-all section.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 42ced9cfee fix: swap date and source URL positions in article cards 2 months ago
oabrivard 598211167d feat: show source URL next to date in synthesis article cards
Date aligned left, source URL aligned right. URL stripped of protocol
and truncated to 40 chars with "..." if too long. Full URL on hover.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 48cad8144b fix: show schedule panel before sources in theme settings
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard f0b60f3f13 fix: return 204 No Content from preferred sources endpoint
The API client expects empty responses to use 204, not 200.
Returning 200 with no body caused JSON parse error in the frontend.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard a566a60663 Code improvement after a code review with Codex 2 months ago
oabrivard 2822baf50d fix: add theme_id to preferred sources pipeline test
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 6cf2b9f5a4 fix: update sources integration tests for multi-theme (add theme_id everywhere)
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 0a0684e42e refactor: decompose ThemeManager into ThemeContentForm + ThemeSourceList sub-components
Extract content settings card and sources card into dedicated components,
reducing ThemeManager from 938 to 233 lines while keeping theme list CRUD
and selector in the parent.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 68b1956059 refactor: extract synthesis helpers (assign_category, filter_phase2_url, tracing) into helpers.rs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard b60a55993c fix: P2 audit items — use API client for stop, replace raw buttons, remove deprecated doc refs
- Replace raw fetch in handleStop with synthesesApi.stop()
- Add stop() method to synthesesApi
- Replace raw <button> elements in GenerateSynthesis with Button component (generate, retry, stop)
- Remove deprecated LLM link extraction schema reference from technical_specs.md

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
oabrivard b124d73c2a fix: P1 audit items — CSV export theme filter, theme validation, ownership checks, history enums, i18n
- export_csv now accepts optional theme_id query param and filters accordingly
- Add UpdateThemeRequest::validate() with bounds checking; call it in the update handler
- Verify theme ownership in sources::create when theme_id is provided
- Update STATUS_OPTIONS (add filtered_too_old, filtered_not_article; remove filtered_duplicate) and SOURCE_TYPE_OPTIONS (add brave_search; remove overflow) in ArticleHistory
- Replace hardcoded French strings ('Confirmer', 'Erreur inconnue') with t() calls; add settings.apiKeys.unknownError key to fr.ts

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
oabrivard d5d624b896 fix: P0 audit bugs — theme-scoped imports/preferred, creation flow, scheduler timeout, job cleanup
- Bulk/CSV import now passes theme_id through to DB
- Preferred source update scoped by theme_id (no cross-theme reset)
- Theme creation sends sensible defaults from frontend
- Scheduler wraps generation in 15-minute timeout
- Job store cleanup runs every 5 minutes

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2 months ago
oabrivard 58f42d0a87 docs: remove redundancy across documentation — cross-references instead of duplication
Trim architecture.md significantly (section 1 overview, technology stack, deployment topology,
module inventory lists, LLM trait block, pipeline details, data model table, full API tables,
background task list). Replace section 5 API tables with a one-liner. Requirements.md sections
3.1/3.5/3.6/3.7/3.8 and 4.2 condensed with cross-references. deployment.md security feature
list replaced by cross-reference to architecture.md Section 6. functional_specs.md Section 3
gains a cross-reference to technical_specs.md Section 5.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 months ago
oabrivard 7835725fe8 docs: merge algorithm.md into technical_specs.md Section 5
The full pipeline algorithm is now in technical_specs.md with added
details: preferred source ordering, windowed waves, is_article filter,
date fallback, "Articles sans date" category, cancellation support.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 381b479047 docs: remove old documentation (superpowers, audit, team-analysis, implementation-plan)
Replaced by 7 consolidated docs: requirements, functional_specs,
architecture, technical_specs, dev_guidelines, qa_guidelines, deployment.
algorithm.md retained as pipeline reference.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 337ddbe7ce docs: update CLAUDE.md for consolidated documentation and current features
Updated project structure, features list, documentation links, database
tables, testing commands, and environment variables to reflect the
current state (multi-theme, scheduling, preferred sources, etc.)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard f07e91ba11 docs: add consolidated architecture.md and technical_specs.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard d3a4d2c577 docs: add consolidated dev_guidelines.md, qa_guidelines.md, deployment.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 116189d11b docs: add consolidated requirements.md and functional_specs.md
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard fa793de8bf test: add scheduler unit test and find_due_schedules integration tests
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard 3dea7bf286 fix: replace hardcoded French strings with i18n keys in SynthesisDetail
Replace "Lire la suite" and "Reduire" with t('synthesis.readMore')
and t('synthesis.collapse'). Adds both keys to fr.ts.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 7f647bc656 refactor: extract JobStore to services/job_store.rs
Moves JobEntry, JobStore, ProgressEvent, JOB_TTL, and emit_progress
to a dedicated module. Updates imports in synthesis.rs, generation.rs,
scheduler.rs, and app_state.rs. synthesis.rs re-exports for backward
compatibility.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 1ab9c817e4 refactor: extract scrape_and_classify_batch from synthesis pipeline
Replaces ~200 duplicated lines in Phase 1 (personalized sources) and
Phase 2 (Brave Search) with a shared scrape_and_classify_batch function.
Uses ScrapeClassifyCtx to bundle shared parameters. Also prepares
synthesis.rs for JobStore extraction by re-exporting from job_store.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 381e11a5e4 refactor: delete dead Sources.tsx, move URL utils to utils/url.ts
normalizeUrl and isValidUrl are now in ~/utils/url. ThemeManager
and sources-utils tests import from the new location. The /sources
route redirect to /themes is preserved in App.tsx.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard c51a99051f fix: update failing frontend tests for multi-theme migration
Settings tests now reference fields that exist in the current UI
(max articles per source instead of removed theme field). Generate
tests now mock the themes API and use current pipeline step names.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard b30d04c6c5 docs: add v2 code audit reports from 5-agent team
Architect, Frontend Expert, Rust Expert, Tech Lead, and QA Engineer
analyzed the codebase post multi-theme/scheduling features. Key findings:
synthesis.rs God Module (2010 lines), ThemeManager.tsx (935 lines),
scheduler untested, 15 test coverage gaps identified.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 1b20d38bbd fix: add TechCrunch source and increase retries for flaky generation test
The live generation test depends on real OpenAI + web scraping.
Adding a second source improves chances of finding articles.
Retries increased from 1 to 2.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 7d58b6e019 fix: enable article history in preferred sources test
article_history_days=0 disables "used" trace entries, so the test
found 0 entries. Changed to 90 to enable tracing.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 9ee372aef3 docs: add test coverage gap report v2 3 months ago
oabrivard c16c588752 test: add stop generation, LLM logs, and preferred ordering tests (GAP-1,2,3)
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard e97b01c819 test: add schedule CRUD integration tests and E2E
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard f989f592a9 feat: add schedule UI — day picker, time, emails in theme management
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard a068d04fa8 feat: add background scheduler for automated synthesis generation
Spawns a tokio task that checks for due schedules every 60 seconds,
runs generation via run_generation_inner, and sends emails to configured
recipients before marking each schedule as run.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard 384649b2b6 feat: add theme schedules — model, DB, CRUD handler, routes
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard 848a25235e docs: add implementation plan for scheduled synthesis generation
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 96f138bd61 docs: add spec for scheduled synthesis generation with email delivery
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard e43a4d2180 feat: add preferred sources — prioritized during synthesis generation
Users can mark sources as preferred via star buttons on the theme page.
Preferred sources are processed first in the pipeline (ordered before
non-preferred in waves, shuffled separately then merged).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 48b5e77e7e docs: add spec for preferred sources feature
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 78844c4ebe chore: remove unused test_settings() function from prompts.rs
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 885af2d147 fix: update E2E tests for multi-theme migration (settings, sources, generation)
- settings.spec.ts: test batch_size instead of removed theme field
- settings-export.spec.ts: test batch_size export/import, open collapsed details section
- sources.spec.ts: convert to API-based test since sources now belong to themes
- generation-live.spec.ts: already updated (no changes needed)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard 6f3e6883c9 feat: add stop generation button — saves partial synthesis on cancel
Adds Arc<AtomicBool> cancellation flag to JobStore/JobEntry. The pipeline
checks the flag before each wave and after each batch, then saves whatever
articles have been collected. A new POST /syntheses/generate/:job_id/stop
endpoint sets the flag. The frontend shows a red stop button during generation
and POSTs to the stop endpoint on click.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
3 months ago
oabrivard 7ba1da4d92 fix: use batch_size=1 for diversity test + rename Autre to Divers in overflow test
Diversity filter works across batches (source_counts updated after classify).
With batch_size=5, all 3 articles fit in one batch, bypassing the filter.
batch_size=1 forces per-article processing so the filter triggers.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago
oabrivard e444f79c0b fix: mock provider returns today's date in classify response
Without a date, articles are routed to "Articles sans date" instead
of their classified category, breaking pipeline tests.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3 months ago