rss-news/backend/tests
Oliver G 7163b1bd7e
feat(wordpress): only assign tags that are established
_resolve_wp_tag_ids created a WordPress tag for every keyword the rewriter
invented, up to 12 per post. That is where the 3.055 tags for 955 posts
came from - 1.683 of them used exactly once, 473 attached to no post at
all. The categories are stable now, but the tags would simply grow back.

Three changes, all on the write path:

A proposed tag has to appear for wordpress_new_tag_min_proposals (3)
different articles before it is created. Proposals are counted in the new
tag_proposals table, keyed on (name, article), so re-publishing an article
does not inflate its own count. Tags that already exist in WordPress are
assigned as before - the gate only guards creation.

Only the first wordpress_max_tags_per_post (5) tags reach WordPress. The
full list still feeds the category rules, which were validated against it.

The lookup fallback of reusing the first search hit is gone. It filed
"Camping" under the unrelated existing tag "Campingplatz" whenever the
exact tag was missing, which quietly produced wrong tags rather than none.

If the proposal bookkeeping fails, nothing is creatable that run: existing
tags still get assigned and the taxonomy stays put, rather than falling
back to creating everything.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-07-31 08:21:53 +02:00
..
__init__.py feat: rebuild rss-news backend, admin ui, and legal extraction pipeline 2026-02-18 09:52:36 +01:00
test_admin_ui.py feat(rewrite): add batch rewrite run, AI tags for WP, and agentur contact detection 2026-02-21 14:39:47 +01:00
test_api_auth.py feat(export): add csv/json article export with date relevance scoring 2026-02-18 10:04:38 +01:00
test_article_workflow.py feat(admin): add feed/source management, rewrite editor, reopen flow, and WP block output 2026-02-21 14:03:49 +01:00
test_categorize.py feat(wordpress): set post category from title and tag rules 2026-07-31 08:00:32 +02:00
test_db_repositories.py feat(publisher): add wordpress draft queue with retry and admin controls 2026-02-18 10:49:43 +01:00
test_ingestion.py test(ingestion): update test for removed Ampel risk-level check 2026-03-21 09:41:34 +00:00
test_publisher.py feat(publisher): add wordpress draft queue with retry and admin controls 2026-02-18 10:49:43 +01:00
test_relevance.py feat(export): add csv/json article export with date relevance scoring 2026-02-18 10:04:38 +01:00
test_scheduler.py Use four fixed daily publish slots 2026-07-24 10:38:04 +02:00
test_source_extraction.py feat(rewrite): add batch rewrite run, AI tags for WP, and agentur contact detection 2026-02-21 14:39:47 +01:00
test_wordpress.py feat(wordpress): only assign tags that are established 2026-07-31 08:21:53 +02:00