Skip to content

VoucherBot v2.1.0

Latest

Choose a tag to compare

@Devathmaj Devathmaj released this 17 Aug 12:31
· 1 commit to main since this release

v2.1.0 — AI-Assisted Deduplication

Deduplication is now more resilient than ever. VoucherBot no longer relies on a purely deterministic score to decide whether two promotions are the same real-world deal — a reasoning model now reviews ambiguous cases, and a new sweeping job reconciles duplicates that were previously missed.

What changed since v2.0.1

Smarter merge decisions

Previously, merge decisions were made by a weighted score over structured fields with hard thresholds. Semantically-similar promotions (different wording, tracking URLs, discount formatting) were often misjudged — causing duplicate events or false merges that destroyed provenance.

Now:

  • qwen-backed matching at ingestion. Candidates that pass a deterministic gate are submitted to the qwen reasoning model, which judges whether two promotions are the same real-world offer. Verdicts map to auto-merge (confidence ≥ 0.8), possible-match (≥ 0.5), or a new event — with a match_reason audit field recording the decision.
  • Resilient fallback. If no Groq key is configured or the model is unavailable, the legacy deterministic scoring path runs unchanged. Parse or model failure never fails the pipeline — it degrades gracefully.

Retroactive consolidation sweep

Two posts for the same promotion processed on different sweeps each used to create their own canonical event, and nothing reconciled them later. That is now fixed:

  • A new scheduled job groups active events by a cheap identity signal (registration URL, voucher code, vendor), gates pairs by the deterministic score, and has qwen confirm whether each pair is the same promotion.
  • Survivor keeps the event with more posts (ties keep the older); the absorbed event is archived, its posts re-pointed, and audit entries appended to both merge logs.
  • The sweep is throttled, cross-instance locked via a Postgres advisory lock, bounded per sweep, and absorption is never double-applied — so it is safe to run on the free Render plan.

Documentation & README

  • Documentation reconciled with the current codebase: API surface, data models, settings tables, module maps, schema revision, and test counts / line references in docs/.
  • README now points to the companion Notification-Bot repository that contains the Discord/Telegram bot code.

Behavior notes

  • New / possible / weakly-confirmed items still notify and share the same qwen judgment; confirmed auto-merges stay silent.
  • When GROQ_API_KEY is unset, everything runs the legacy deterministic path exactly as before.

Testing

  • 418 passed, 15 skipped (12 new test files covering the AI matcher and consolidation sweep).
  • ruff check + ruff format --check clean, mypy --strict clean (81 files).

Full Changelog: v2.0.1...v2.1.0