VoucherBot v1.1.0
v1.1.0 — Migration-Led Schema, Weighted AI Routing, Reddit RSS-by-Default & Content Retention
Minor release: Alembic migrations are now the single source of truth for the database schema (applied automatically at startup), Groq calls are routed 40/40/20 across the gpt-oss model family with quota-aware fallbacks, Reddit collection defaults to public RSS only (no OAuth calls), the Reddit source catalog is curated, and the scheduler now nulls out the content column of posts older than the retention window.
What changed since v1.0.4
Two pull requests landed since v1.0.4:
- feat: migration-led schema, weighted Groq routing, Reddit RSS-by-default
- feat: purge content of posts past retention window in scheduler
New Features
- Alembic migrations are now authoritative (PR #15) —
alembic upgrade headruns automatically at startup whenIS_PROD=false, so a brand-new system boots end-to-end (schema + seed data) with zero manual steps. The migration chain fully reproduces the schema the running models define, including tables, enums, indexes, and thevoucher_postsview. - Weighted Groq model routing (PR #15) — replaced the fixed round-robin batch with weighted 40/40/20 distribution across
openai/gpt-oss-20b/openai/gpt-oss-120b/llama-3.3-70b-versatile, each respecting its TPM/TPD/RPD quota. Exhausted models are skipped, failures fall back to remaining models, and Gemini remains the final fallback. - Reddit RSS-by-default (PR #15) —
REDDIT_INGESTION_ENABLED=false(the default) now collects Reddit purely via public RSS feeds and never calls the OAuth API, regardless of whether credentials are configured. Reddit sources are no longer filtered out of the scheduler when ingestion is disabled. - Curated Reddit source catalog (PR #15) — refreshed the default subreddit list (added
O365Certification,mcsa,ccnp,linuxadmin,salesforce,vmware; removedMicrosoftLearn,LinuxCertifications,eFreebies,FREE). Stale subreddits no longer in the catalog are auto-disabled. - Post content retention (PR #16) — the scheduler now nulls out
posts.contentfor every post older thancontent_retention_days(default 7), keeping the column bounded. A rawUPDATE ... SET content = NULLis used so only the content column is touched (no accidentalupdated_atwrites).
Reliability / Schema
- Migration chain rebuilt (PR #15) — the schema-freeze keyword migration now creates its table unconditionally, the redundant vendor-mappings freeze was removed, and two new migrations add the
PEARSONVUE/TRAINING_PROVIDERsource types and reconcilecreate_all-built DBs (creates thevoucher_postsview, makesvendor_mappingstimestamps timezone-aware).alembic checkis clean after applying. migrations/env.pyhardening (PR #15) —%in the DB URL is escaped (fixes a configparser interpolation crash on percent-encoded passwords), all models are registered inBase.metadata, and view-backed models are excluded from autogenerate.- Model/migration alignment (PR #15) —
vendor_mappings.url_patternunique index,keywordserver defaults, timezone-awarevendor_mappingtimestamps. - Retention is configurable (PR #16) — new
CONTENT_RETENTION_DAYSsetting (default 7); the sweep is idempotent (content IS NOT NULLguard) and runs once per scheduler loop iteration.
Housekeeping
- Dropped author capture on Reddit (PR #15) — keeps
[deleted]-style noise out of the pipeline. - Docs & source catalog sync (PR #15) — Reddit RSS behavior, OAuth settings, setup instructions, and contributor checklists clarified;
Sources/Subreddit.txtrefreshed.
Testing
- New unit tests for the migration graph, startup lifespan wiring, Reddit source disabling, collectors, and the analyzer (PR #15).
- New
tests/test_retention.pycovers the retention SQL shape (SET clause contains exactlycontent, neverupdated_at/summary), NULL-skipping, rowcount, and error swallowing (PR #16). - Full suite: 359 passed, 15 skipped. All CI quality gates pass:
ruff format --check,ruff check,mypy voucherbot tests, and the fullpytestsuite.
Upgrade notes
On a brand-new empty DB, alembic upgrade head at startup builds the complete schema automatically. For existing create_all-built DBs, apply the new m6n7o8p9q0r1 reconciliation migration (alembic upgrade head) — alembic check passes cleanly afterwards.
Full Changelog: v1.0.4...v1.1.0